Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions backend/grants/migrations/0024_alter_grant_age_group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.1.1 on 2024-12-02 12:26

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('grants', '0023_alter_grant_grant_type'),
]

operations = [
migrations.AlterField(
model_name='grant',
name='age_group',
field=models.CharField(blank=True, choices=[('range_under_18', 'Under 18 years old'), ('range_18_24', '18 - 24 years old'), ('range_25_34', '25 - 34 years old'), ('range_35_44', '35 - 44 years old'), ('range_45_54', '45 - 54 years old'), ('range_55_64', '55 - 64 years old'), ('range_more_than_65', '65 years or older')], max_length=20, verbose_name='Age group'),
),
]
5 changes: 2 additions & 3 deletions backend/grants/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ class CountryType(models.TextChoices):
extra_eu = "extra_eu", _("Extra EU")

class AgeGroup(models.TextChoices):
range_less_than_10 = "range_less_than_10", _("10 years old or under")
range_11_18 = "range_11_18", _("11 - 18 years old")
range_19_24 = "range_19_24", _("19 - 24 years old")
range_under_18 = "range_under_18", _("Under 18 years old")
range_18_24 = "range_18_24", _("18 - 24 years old")
range_25_34 = "range_25_34", _("25 - 34 years old")
range_35_44 = "range_35_44", _("35 - 44 years old")
range_45_54 = "range_45_54", _("45 - 54 years old")
Expand Down
14 changes: 4 additions & 10 deletions frontend/src/components/grant-form/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,15 @@ export const AGE_GROUPS_OPTIONS = [
messageId: "global.selectOption",
},
{
value: AgeGroup.RangeLessThan_10,
value: AgeGroup.RangeUnder_18,
disabled: false,
messageId: "grants.form.fields.ageGroup.values.range_less_than_10",
isAgeInRange: (age: number) => age <= 10,
},
{
value: AgeGroup.Range_11_18,
disabled: false,
messageId: "grants.form.fields.ageGroup.values.range_11_18",
messageId: "grants.form.fields.ageGroup.values.range_under_18",
isAgeInRange: (age: number) => 11 <= age && age <= 18,
},
{
value: AgeGroup.Range_19_24,
value: AgeGroup.Range_18_24,
disabled: false,
messageId: "grants.form.fields.ageGroup.values.range_19_24",
messageId: "grants.form.fields.ageGroup.values.range_18_24",
isAgeInRange: (age: number) => 19 <= age && age <= 24,
},
{
Expand Down
11 changes: 4 additions & 7 deletions frontend/src/locale/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -717,10 +717,8 @@ We look forward to reading about you and hope to see you at PyCon Italia!
"grants.form.fields.ageGroup": "Age group",
"grants.form.fields.ageGroup.description":
"Select your age group. This helps us understand the demographic distribution of our applicants.",
"grants.form.fields.ageGroup.values.range_less_than_10":
"10 years old or under",
"grants.form.fields.ageGroup.values.range_11_18": "11 - 18 years old",
"grants.form.fields.ageGroup.values.range_19_24": "19 - 24 years old",
"grants.form.fields.ageGroup.values.range_under_18": "Under 18 years old",
"grants.form.fields.ageGroup.values.range_18_24": "18 - 24 years old",
"grants.form.fields.ageGroup.values.range_25_34": "25 - 34 years old",
"grants.form.fields.ageGroup.values.range_35_44": "35 - 44 years old",
"grants.form.fields.ageGroup.values.range_45_54": "45 - 54 years old",
Expand Down Expand Up @@ -1442,9 +1440,8 @@ Non vediamo l'ora di leggere la tua storia e speriamo di vederti a PyCon Italia!
"grants.form.fields.ageGroup": "Fascia d'età",
"grants.form.fields.ageGroup.description":
"Seleziona la tua fascia d'età. Questo ci aiuta a comprendere la distribuzione demografica dei nostri candidati.",
"grants.form.fields.ageGroup.values.range_less_than_10": "meno di 10 anni",
"grants.form.fields.ageGroup.values.range_11_18": "11 - 18 anni",
"grants.form.fields.ageGroup.values.range_19_24": "19 - 24 anni",
"grants.form.fields.ageGroup.values.range_under_18": "meno di 18 anni",
"grants.form.fields.ageGroup.values.range_18_24": "18 - 24 anni",
"grants.form.fields.ageGroup.values.range_25_34": "25 - 34 anni",
"grants.form.fields.ageGroup.values.range_35_44": "35 - 44 anni",
"grants.form.fields.ageGroup.values.range_45_54": "45 - 54 anni",
Expand Down