diff --git a/applications/forms/hacker.py b/applications/forms/hacker.py index 2fbbd9dd..29600733 100644 --- a/applications/forms/hacker.py +++ b/applications/forms/hacker.py @@ -7,6 +7,7 @@ class HackerApplicationForm(_BaseApplicationForm): bootstrap_field_info = { "🎓 Education Info": { "fields": [ + {"name": "kind_studies", "space": 12}, {"name": "university", "space": 12}, {"name": "degree", "space": 12}, {"name": "graduation_year", "space": 12}, @@ -129,8 +130,24 @@ def clean_projects(self): ) return data + def clean_kind_studies(self): + data = self.cleaned_data["kind_studies"] + if not data or data == "": + raise forms.ValidationError("Please select your current studies.") + return data + first_timer = common_first_timer() + + kind_studies = forms.ChoiceField( + required=True, + label='What kind of studies are you currently pursuing?', + choices=([('', '- Select an option -')] + models.constants.KIND_STUDIES), + widget=forms.Select( + attrs={'class': 'form-control'} + ) + ) + university = common_university() diff --git a/applications/migrations/0060_hackerapplication_kind_studies.py b/applications/migrations/0060_hackerapplication_kind_studies.py new file mode 100644 index 00000000..c3bce53d --- /dev/null +++ b/applications/migrations/0060_hackerapplication_kind_studies.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.23 on 2025-12-11 03:00 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('applications', '0059_remove_volunteerapplication_pronouns'), + ] + + operations = [ + migrations.AddField( + model_name='hackerapplication', + name='kind_studies', + field=models.CharField(choices=[('SECONDARY', 'Secondary Education - Baccalaureate'), ('VOCATIONAL', 'Vocational Training (FP)'), ('BACHELOR', 'Bachelor’s Degree'), ('MASTER', 'Master’s Degree'), ('OTHER', 'Other')], default='NA', max_length=300), + ), + ] diff --git a/applications/models/constants.py b/applications/models/constants.py index dded778c..dd79e66a 100644 --- a/applications/models/constants.py +++ b/applications/models/constants.py @@ -91,6 +91,17 @@ (2, "Sunday") ] +ST_SECONDARY = 'SECONDARY' +ST_VOCATIONAL = 'VOCATIONAL' +ST_BACHELOR = 'BACHELOR' +ST_MASTER = 'MASTER' +ST_OTHER = 'OTHER' + +KIND_STUDIES = [ + (ST_SECONDARY, 'Secondary Education - Baccalaureate'), (ST_VOCATIONAL, 'Vocational Training (FP)'), + (ST_BACHELOR, 'Bachelor’s Degree'), (ST_MASTER, 'Master’s Degree'), (ST_OTHER, 'Other') +] + HACK_NAME = getattr(hackathon_variables, 'HACKATHON_NAME', "HackAssistant") EXTRA_NAME = [' 2016 Fall', ' 2016 Winter', ' 2017 Fall', ' 2017 Winter', ' 2018', ' 2019', ' 2021', ' 2022', ' 2023', ' 2024'] PREVIOUS_HACKS = [(i, HACK_NAME + EXTRA_NAME[i]) for i in range(0, len(EXTRA_NAME))] diff --git a/applications/models/hacker.py b/applications/models/hacker.py index 6e0a2dd9..facece33 100644 --- a/applications/models/hacker.py +++ b/applications/models/hacker.py @@ -13,7 +13,8 @@ class HackerApplication(BaseApplication): # Random lenny face lennyface = models.CharField(max_length=20, default="-.-") - # University + # Studies + kind_studies = models.CharField(max_length=300, choices=KIND_STUDIES, default=NO_ANSWER) graduation_year = models.IntegerField(choices=YEARS, default=DEFAULT_YEAR) university = models.CharField(max_length=300) degree = models.CharField(max_length=300)