From 50bedc204355d3a92a2bea0abdad57c800ad7eaa Mon Sep 17 00:00:00 2001 From: Derek Date: Sun, 22 Nov 2026 17:23:56 -0500 Subject: [PATCH 1/6] feat: application button --- hackathon_site/event/jinja2/event/base.html | 8 +++++--- hackathon_site/event/jinja2/event/landing.html | 2 ++ hackathon_site/event/tests.py | 15 +++++++++++---- .../hackathon_site/settings/__init__.py | 4 ++-- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/hackathon_site/event/jinja2/event/base.html b/hackathon_site/event/jinja2/event/base.html index 73234f9..c3ce355 100644 --- a/hackathon_site/event/jinja2/event/base.html +++ b/hackathon_site/event/jinja2/event/base.html @@ -50,9 +50,11 @@ Logout {% else %} -
  • - Register Your Interest -
  • + {% if is_registration_open() %} +
  • + Apply +
  • + {% endif %} {% endif %} {% endblock %} diff --git a/hackathon_site/event/jinja2/event/landing.html b/hackathon_site/event/jinja2/event/landing.html index 33971b8..447d061 100644 --- a/hackathon_site/event/jinja2/event/landing.html +++ b/hackathon_site/event/jinja2/event/landing.html @@ -102,6 +102,7 @@

    + {% if not is_registration_open() %}
    {% set msgs = get_messages(request) %} @@ -169,6 +170,7 @@

    Register Your Interest

    + {% endif %}
    diff --git a/hackathon_site/event/tests.py b/hackathon_site/event/tests.py index 1c7cd68..a2c3e52 100644 --- a/hackathon_site/event/tests.py +++ b/hackathon_site/event/tests.py @@ -85,7 +85,7 @@ class IndexViewTestCase(SetupUserMixin, TestCase): """ Tests for the landing page template. - We test for correct rendering and rendering of Logout/Register Your Interest buttons + We test the landing page links for open and closed registration. """ def setUp(self): @@ -95,8 +95,12 @@ def setUp(self): def test_index_view(self): response = self.client.get(self.view) self.assertEqual(response.status_code, status.HTTP_200_OK) - self.assertContains(response, "Register Your Interest") - self.assertContains(response, 'href="#interest"') + self.assertContains( + response, + 'class="btn-small waves-effect waves-light colorBtn">Apply', + count=2, + ) + self.assertNotContains(response, "Register Your Interest") self.assertContains(response, "Apply") self.assertContains(response, reverse("registration:signup")) @@ -134,9 +138,12 @@ def test_no_apply_button_when_registration_closed(self, mock_is_registration_ope mock_is_registration_open.return_value = False response = self.client.get(self.view) self.assertNotContains(response, reverse("registration:signup")) + self.assertNotContains(response, 'href="#interest"') - def test_interest_form_renders(self): + @patch("event.views.is_registration_open") + def test_interest_form_renders(self, mock_is_registration_open): """The public MLH interest form and its checkboxes render on the page.""" + mock_is_registration_open.return_value = False response = self.client.get(self.view) self.assertContains(response, "Register Your Interest") self.assertContains(response, "MLH Code of Conduct") diff --git a/hackathon_site/hackathon_site/settings/__init__.py b/hackathon_site/hackathon_site/settings/__init__.py index cdaa461..e33625c 100644 --- a/hackathon_site/hackathon_site/settings/__init__.py +++ b/hackathon_site/hackathon_site/settings/__init__.py @@ -318,8 +318,8 @@ CONTACT_EMAIL = DEFAULT_FROM_EMAIL HSS_ADMIN_EMAIL = "hardware@makeuoft.ca" -REGISTRATION_OPEN_DATE = datetime(2025, 12, 10, tzinfo=TZ_INFO) -REGISTRATION_CLOSE_DATE = datetime(2026, 1, 28, 23, 59, 0, tzinfo=TZ_INFO) +REGISTRATION_OPEN_DATE = datetime(2026, 11, 21, tzinfo=TZ_INFO) +REGISTRATION_CLOSE_DATE = datetime(2027, 1, 28, 23, 59, 0, tzinfo=TZ_INFO) EVENT_START_DATE = datetime(2026, 2, 14, 8, 0, 0, tzinfo=TZ_INFO) EVENT_END_DATE = datetime(2026, 2, 15, 17, 0, 0, tzinfo=TZ_INFO) HARDWARE_SIGN_OUT_START_DATE = datetime(2026, 2, 8, 23, 59, 0, tzinfo=TZ_INFO) From 4e320ec1b5c136b16ed03e953fc84bbf405ca496 Mon Sep 17 00:00:00 2001 From: Derek Date: Mon, 23 Nov 2026 14:08:39 -0500 Subject: [PATCH 2/6] feat: application form changes --- .../event/jinja2/event/form_base.html | 9 ++++-- .../event/static/event/js/application.js | 2 +- hackathon_site/registration/forms.py | 27 ++++++------------ .../jinja2/registration/application.html | 27 ++++++++++++++---- .../migrations/0016_auto_20261122_1951.py | 28 +++++++++++++++++++ hackathon_site/registration/models.py | 18 ++++++++++++ hackathon_site/registration/test_forms.py | 7 ++--- hackathon_site/registration/test_views.py | 7 ++--- hackathon_site/review/admin.py | 3 ++ 9 files changed, 93 insertions(+), 35 deletions(-) create mode 100644 hackathon_site/registration/migrations/0016_auto_20261122_1951.py diff --git a/hackathon_site/event/jinja2/event/form_base.html b/hackathon_site/event/jinja2/event/form_base.html index 644129a..3087d79 100644 --- a/hackathon_site/event/jinja2/event/form_base.html +++ b/hackathon_site/event/jinja2/event/form_base.html @@ -1,9 +1,12 @@ {% extends "event/base.html" %} -{% macro render_field(field, show_help_text=False, show_label=True, show_help_text_as_label=False, size="s12", id="") %} -
    +{% macro render_field(field, show_help_text=False, show_label=True, show_help_text_as_label=False, size="s12", id="", label_above=False) %} +
    + {% if show_label and label_above %} + + {% endif %} {{ field }} - {% if show_label %} + {% if show_label and not label_above %} {% if show_help_text_as_label %} {% else %} diff --git a/hackathon_site/event/static/event/js/application.js b/hackathon_site/event/static/event/js/application.js index 1ba6285..ab208d7 100644 --- a/hackathon_site/event/static/event/js/application.js +++ b/hackathon_site/event/static/event/js/application.js @@ -1,5 +1,5 @@ $(document).ready(function () { $( - "#what_hackathon_experience, #id_why_participate, #id_what_technical_experience" + "#id_community_problem, #id_proud_project, #id_deadline_plan" ).characterCounter(); }); diff --git a/hackathon_site/registration/forms.py b/hackathon_site/registration/forms.py index f0ab331..86c1642 100644 --- a/hackathon_site/registration/forms.py +++ b/hackathon_site/registration/forms.py @@ -148,10 +148,9 @@ class Meta: "devpost", "how_many_hackathons", "past_hackathon_info", - "what_past_experience", - "why_participate", - "what_technical_experience", - "one_million_dollars_investment", + "community_problem", + "proud_project", + "deadline_plan", "discovery_method", "conduct_agree", "logistics_agree", @@ -187,32 +186,24 @@ class Meta: "data-length": 1000, } ), - "what_past_experience": forms.Textarea( + "community_problem": forms.Textarea( attrs={ "class": "materialize-textarea", - "placeholder": "The most significant challenge I faced in a project/hackathon was...", + "placeholder": "I would use technology to solve...", "data-length": 1000, - "style": "padding-top: 38px;", } ), - "why_participate": forms.Textarea( + "proud_project": forms.Textarea( attrs={ "class": "materialize-textarea", - "placeholder": "I want to participate in MakeUofT because...", + "placeholder": "One project I was especially proud of was...", "data-length": 1000, } ), - "what_technical_experience": forms.Textarea( + "deadline_plan": forms.Textarea( attrs={ "class": "materialize-textarea", - "placeholder": "My technical experience with software and hardware are...", - "data-length": 1000, - } - ), - "one_million_dollars_investment": forms.Textarea( - attrs={ - "class": "materialize-textarea", - "placeholder": "If I had a million dollars to invest in one technology brand, it would be...", + "placeholder": "My plan would be...", "data-length": 1000, } ), diff --git a/hackathon_site/registration/jinja2/registration/application.html b/hackathon_site/registration/jinja2/registration/application.html index 4bef644..62f3900 100644 --- a/hackathon_site/registration/jinja2/registration/application.html +++ b/hackathon_site/registration/jinja2/registration/application.html @@ -6,7 +6,25 @@ {% endblock %} @@ -74,10 +92,9 @@

    Questions

    {{ render_field(form.how_many_hackathons, show_help_text_as_label=True, size="s12 select2-wrapper") }} {{ render_field(form.past_hackathon_info, show_help_text_as_label=True) }} - {{ render_field(form.why_participate, show_help_text_as_label=True) }} - {{ render_field(form.what_technical_experience, show_help_text_as_label=True) }} - {{ render_field(form.what_past_experience, show_help_text_as_label=True) }} - {{ render_field(form.one_million_dollars_investment, show_help_text_as_label=True) }} + {{ render_field(form.community_problem, show_help_text_as_label=True, label_above=True) }} + {{ render_field(form.proud_project, show_help_text_as_label=True, label_above=True) }} + {{ render_field(form.deadline_plan, show_help_text_as_label=True, label_above=True) }} {{ render_field(form.discovery_method, show_help_text_as_label=True, size="s12 select2-wrapper") }}
    diff --git a/hackathon_site/registration/migrations/0016_auto_20261122_1951.py b/hackathon_site/registration/migrations/0016_auto_20261122_1951.py new file mode 100644 index 0000000..3cff94f --- /dev/null +++ b/hackathon_site/registration/migrations/0016_auto_20261122_1951.py @@ -0,0 +1,28 @@ +# Generated by Django 3.2.15 on 2026-11-23 00:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('registration', '0015_fix_mlh_dev_link_text'), + ] + + operations = [ + migrations.AddField( + model_name='application', + name='community_problem', + field=models.TextField(default='', help_text='What is one problem in your community or everyday life that you would like to solve through technology?', max_length=1000), + ), + migrations.AddField( + model_name='application', + name='deadline_plan', + field=models.TextField(default='', help_text='It’s 11 PM, and you have a project due at 11 AM tomorrow. Would you choose to stay up late or wake up early to finish it, and what would your plan be?', max_length=1000), + ), + migrations.AddField( + model_name='application', + name='proud_project', + field=models.TextField(default='', help_text='Tell us a project that you have made in the past (technical or non-technical) that you are most proud of? What aspect of that project stood out to you?', max_length=1000), + ), + ] diff --git a/hackathon_site/registration/models.py b/hackathon_site/registration/models.py index 00b638e..a1a2d30 100644 --- a/hackathon_site/registration/models.py +++ b/hackathon_site/registration/models.py @@ -340,6 +340,24 @@ class Application(models.Model): help_text="If you had a million dollars to invest in one technology brand, what would it be and why?", max_length=1000, ) + community_problem = models.TextField( + null=False, + default="", + help_text="What is one problem in your community or everyday life that you would like to solve through technology?", + max_length=1000, + ) + proud_project = models.TextField( + null=False, + default="", + help_text="Tell us a project that you have made in the past (technical or non-technical) that you are most proud of? What aspect of that project stood out to you?", + max_length=1000, + ) + deadline_plan = models.TextField( + null=False, + default="", + help_text="It’s 11 PM, and you have a project due at 11 AM tomorrow. Would you choose to stay up late or wake up early to finish it, and what would your plan be?", + max_length=1000, + ) discovery_method = models.TextField( null=False, default="", diff --git a/hackathon_site/registration/test_forms.py b/hackathon_site/registration/test_forms.py index 0d3b321..edfc84f 100644 --- a/hackathon_site/registration/test_forms.py +++ b/hackathon_site/registration/test_forms.py @@ -101,10 +101,9 @@ def setUp(self): "program": "computer science", "how_many_hackathons": "2", "past_hackathon_info": "n/a", - "what_past_experience": "foo", - "why_participate": "foo", - "what_technical_experience": "foo", - "one_million_dollars_investment": "foo", + "community_problem": "foo", + "proud_project": "foo", + "deadline_plan": "foo", "discovery_method": "instagram", "conduct_agree": True, "logistics_agree": True, diff --git a/hackathon_site/registration/test_views.py b/hackathon_site/registration/test_views.py index eaa1c32..6571bf4 100644 --- a/hackathon_site/registration/test_views.py +++ b/hackathon_site/registration/test_views.py @@ -189,10 +189,9 @@ def setUp(self): "program": "computer science", "how_many_hackathons": "2", "past_hackathon_info": "n/a", - "what_past_experience": "foo", - "why_participate": "foo", - "what_technical_experience": "foo", - "one_million_dollars_investment": "foo", + "community_problem": "foo", + "proud_project": "foo", + "deadline_plan": "foo", "discovery_method": "instagram", "conduct_agree": True, "logistics_agree": True, diff --git a/hackathon_site/review/admin.py b/hackathon_site/review/admin.py index be934aa..ecb6393 100644 --- a/hackathon_site/review/admin.py +++ b/hackathon_site/review/admin.py @@ -126,6 +126,9 @@ class ApplicationInline(admin.TabularInline): "github", "devpost", "past_hackathon_info", + "community_problem", + "proud_project", + "deadline_plan", "what_past_experience", "why_participate", "what_technical_experience", From 6015c698963ff3b17ab61bf1ab9236d47fa0a240 Mon Sep 17 00:00:00 2001 From: Derek Date: Mon, 23 Nov 2026 14:30:56 -0500 Subject: [PATCH 3/6] fix: formatting issue to pass ci --- .../event/static/event/js/application.js | 4 +-- .../migrations/0016_auto_20261122_1951.py | 32 +++++++++++++------ 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/hackathon_site/event/static/event/js/application.js b/hackathon_site/event/static/event/js/application.js index ab208d7..39d4e73 100644 --- a/hackathon_site/event/static/event/js/application.js +++ b/hackathon_site/event/static/event/js/application.js @@ -1,5 +1,3 @@ $(document).ready(function () { - $( - "#id_community_problem, #id_proud_project, #id_deadline_plan" - ).characterCounter(); + $("#id_community_problem, #id_proud_project, #id_deadline_plan").characterCounter(); }); diff --git a/hackathon_site/registration/migrations/0016_auto_20261122_1951.py b/hackathon_site/registration/migrations/0016_auto_20261122_1951.py index 3cff94f..e977989 100644 --- a/hackathon_site/registration/migrations/0016_auto_20261122_1951.py +++ b/hackathon_site/registration/migrations/0016_auto_20261122_1951.py @@ -6,23 +6,35 @@ class Migration(migrations.Migration): dependencies = [ - ('registration', '0015_fix_mlh_dev_link_text'), + ("registration", "0015_fix_mlh_dev_link_text"), ] operations = [ migrations.AddField( - model_name='application', - name='community_problem', - field=models.TextField(default='', help_text='What is one problem in your community or everyday life that you would like to solve through technology?', max_length=1000), + model_name="application", + name="community_problem", + field=models.TextField( + default="", + help_text="What is one problem in your community or everyday life that you would like to solve through technology?", + max_length=1000, + ), ), migrations.AddField( - model_name='application', - name='deadline_plan', - field=models.TextField(default='', help_text='It’s 11 PM, and you have a project due at 11 AM tomorrow. Would you choose to stay up late or wake up early to finish it, and what would your plan be?', max_length=1000), + model_name="application", + name="deadline_plan", + field=models.TextField( + default="", + help_text="It’s 11 PM, and you have a project due at 11 AM tomorrow. Would you choose to stay up late or wake up early to finish it, and what would your plan be?", + max_length=1000, + ), ), migrations.AddField( - model_name='application', - name='proud_project', - field=models.TextField(default='', help_text='Tell us a project that you have made in the past (technical or non-technical) that you are most proud of? What aspect of that project stood out to you?', max_length=1000), + model_name="application", + name="proud_project", + field=models.TextField( + default="", + help_text="Tell us a project that you have made in the past (technical or non-technical) that you are most proud of? What aspect of that project stood out to you?", + max_length=1000, + ), ), ] From f6bf7555db1b5d94fca831eef0098e14e8b72bb3 Mon Sep 17 00:00:00 2001 From: Derek Date: Mon, 23 Nov 2026 14:39:41 -0500 Subject: [PATCH 4/6] fix: MLH checkboxes --- .../migrations/0014_auto_20261123_1432.py | 31 +++++++++++++++++++ hackathon_site/event/models.py | 6 ++-- .../migrations/0017_auto_20261123_1432.py | 31 +++++++++++++++++++ hackathon_site/registration/models.py | 6 ++-- 4 files changed, 68 insertions(+), 6 deletions(-) create mode 100644 hackathon_site/event/migrations/0014_auto_20261123_1432.py create mode 100644 hackathon_site/registration/migrations/0017_auto_20261123_1432.py diff --git a/hackathon_site/event/migrations/0014_auto_20261123_1432.py b/hackathon_site/event/migrations/0014_auto_20261123_1432.py new file mode 100644 index 0000000..48e6218 --- /dev/null +++ b/hackathon_site/event/migrations/0014_auto_20261123_1432.py @@ -0,0 +1,31 @@ +# Generated by Django 3.2.15 on 2026-11-23 19:32 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("event", "0013_fix_mlh_dev_link_text"), + ] + + operations = [ + migrations.AlterField( + model_name="interestsubmission", + name="email_agree", + field=models.BooleanField( + blank=True, + default=False, + help_text="I authorize MLH and DEV to send me occasional emails about relevant events, career opportunities, and community announcements.", + null=True, + ), + ), + migrations.AlterField( + model_name="interestsubmission", + name="logistics_agree", + field=models.BooleanField( + default=False, + help_text='I authorize you to share my application/registration information with Major League Hacking for event administration, ranking, and administration (including the creation of linked accounts on MLH and DEV) in line with the MLH Privacy Policy. I further agree to the terms of both the MLH Contest Terms and Conditions and the MLH Privacy Policy.', + ), + ), + ] diff --git a/hackathon_site/event/models.py b/hackathon_site/event/models.py index 884bf63..6367181 100644 --- a/hackathon_site/event/models.py +++ b/hackathon_site/event/models.py @@ -337,17 +337,17 @@ class InterestSubmission(models.Model): help_text="I authorize you to share my application/registration information with Major League Hacking" " for event administration, ranking, and administration (including the creation of linked accounts on MLH and " 'DEV) in line with the ' - "MLH Privacy Policy. " + 'MLH Privacy Policy. ' "I further agree to the terms of both the " 'MLH Contest Terms and Conditions' " and the " - "MLH Privacy Policy.", + 'MLH Privacy Policy.', blank=False, null=False, default=False, ) email_agree = models.BooleanField( - help_text="I authorize MLH + DEV to send me occasional emails about relevant events, career opportunities, and community announcements.", + help_text="I authorize MLH and DEV to send me occasional emails about relevant events, career opportunities, and community announcements.", blank=True, null=True, default=False, diff --git a/hackathon_site/registration/migrations/0017_auto_20261123_1432.py b/hackathon_site/registration/migrations/0017_auto_20261123_1432.py new file mode 100644 index 0000000..8dd3a9a --- /dev/null +++ b/hackathon_site/registration/migrations/0017_auto_20261123_1432.py @@ -0,0 +1,31 @@ +# Generated by Django 3.2.15 on 2026-11-23 19:32 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("registration", "0016_auto_20261122_1951"), + ] + + operations = [ + migrations.AlterField( + model_name="application", + name="email_agree", + field=models.BooleanField( + blank=True, + default=False, + help_text="I authorize MLH and DEV to send me occasional emails about relevant events, career opportunities, and community announcements.", + null=True, + ), + ), + migrations.AlterField( + model_name="application", + name="logistics_agree", + field=models.BooleanField( + default=False, + help_text='I authorize you to share my application/registration information with Major League Hacking for event administration, ranking, and administration (including the creation of linked accounts on MLH and DEV) in line with the MLH Privacy Policy. I further agree to the terms of both the MLH Contest Terms and Conditions and the MLH Privacy Policy.', + ), + ), + ] diff --git a/hackathon_site/registration/models.py b/hackathon_site/registration/models.py index a1a2d30..4265c9c 100644 --- a/hackathon_site/registration/models.py +++ b/hackathon_site/registration/models.py @@ -376,18 +376,18 @@ class Application(models.Model): help_text="I authorize you to share my application/registration information with Major League Hacking" " for event administration, ranking, and administration (including the creation of linked accounts on MLH and " 'DEV) in line with the ' - "MLH Privacy Policy. " + 'MLH Privacy Policy. ' "I further agree to the terms of both the " 'MLH Contest Terms and Conditions' " and the " - "MLH Privacy Policy.", + 'MLH Privacy Policy.', blank=False, null=False, default=False, ) email_agree = models.BooleanField( - help_text="I authorize MLH + DEV to send me occasional emails about relevant events, career opportunities, and community announcements.", + help_text="I authorize MLH and DEV to send me occasional emails about relevant events, career opportunities, and community announcements.", blank=True, null=True, default=False, From 6593952e671a0a26c6895e9e8081af96a23cccf7 Mon Sep 17 00:00:00 2001 From: Derek Date: Sat, 28 Nov 2026 18:07:12 -0500 Subject: [PATCH 5/6] feat: 250 word limit, instead of 1000 chrs --- .../event/static/event/js/application.js | 16 ++++++- hackathon_site/registration/forms.py | 25 +++++++++-- .../jinja2/registration/application.html | 6 +-- .../0018_written_response_word_limit.py | 42 +++++++++++++++++++ hackathon_site/registration/models.py | 4 -- hackathon_site/registration/test_forms.py | 25 +++++++++++ 6 files changed, 106 insertions(+), 12 deletions(-) create mode 100644 hackathon_site/registration/migrations/0018_written_response_word_limit.py diff --git a/hackathon_site/event/static/event/js/application.js b/hackathon_site/event/static/event/js/application.js index 39d4e73..bca0df4 100644 --- a/hackathon_site/event/static/event/js/application.js +++ b/hackathon_site/event/static/event/js/application.js @@ -1,3 +1,17 @@ $(document).ready(function () { - $("#id_community_problem, #id_proud_project, #id_deadline_plan").characterCounter(); + $("textarea[data-max-words]").each(function () { + const field = $(this); + const limit = Number(field.attr("data-max-words")); + const counter = $(''); + field.parent().append(counter); + + function updateCount() { + const words = field.val().trim().split(/\s+/).filter(Boolean).length; + counter.text(`${words} / ${limit} words`); + counter.toggleClass("red-text", words > limit); + } + + field.on("input", updateCount); + updateCount(); + }); }); diff --git a/hackathon_site/registration/forms.py b/hackathon_site/registration/forms.py index 86c1642..046b4c0 100644 --- a/hackathon_site/registration/forms.py +++ b/hackathon_site/registration/forms.py @@ -13,6 +13,21 @@ from registration.widgets import MaterialFileInput from review.models import Review +MAX_WRITTEN_RESPONSE_WORDS = 250 +WRITTEN_RESPONSE_FIELDS = ( + "past_hackathon_info", + "community_problem", + "proud_project", + "deadline_plan", +) + + +def validate_written_response_length(value): + if len(value.split()) > MAX_WRITTEN_RESPONSE_WORDS: + raise forms.ValidationError( + _("Please use no more than 250 words."), code="too_many_words" + ) + class SignUpForm(UserCreationForm): """ @@ -183,28 +198,28 @@ class Meta: attrs={ "class": "materialize-textarea", "placeholder": "Insert past hackathon description here...", - "data-length": 1000, + "data-max-words": MAX_WRITTEN_RESPONSE_WORDS, } ), "community_problem": forms.Textarea( attrs={ "class": "materialize-textarea", "placeholder": "I would use technology to solve...", - "data-length": 1000, + "data-max-words": MAX_WRITTEN_RESPONSE_WORDS, } ), "proud_project": forms.Textarea( attrs={ "class": "materialize-textarea", "placeholder": "One project I was especially proud of was...", - "data-length": 1000, + "data-max-words": MAX_WRITTEN_RESPONSE_WORDS, } ), "deadline_plan": forms.Textarea( attrs={ "class": "materialize-textarea", "placeholder": "My plan would be...", - "data-length": 1000, + "data-max-words": MAX_WRITTEN_RESPONSE_WORDS, } ), "phone_number": forms.TextInput(attrs={"placeholder": "+1 (123) 456-7890"}), @@ -217,6 +232,8 @@ def __init__(self, *args, **kwargs): self.label_suffix = "" self.fields["conduct_agree"].required = True self.fields["logistics_agree"].required = True + for field_name in WRITTEN_RESPONSE_FIELDS: + self.fields[field_name].validators.append(validate_written_response_length) def clean(self): if not is_registration_open(): diff --git a/hackathon_site/registration/jinja2/registration/application.html b/hackathon_site/registration/jinja2/registration/application.html index 62f3900..a3da9f1 100644 --- a/hackathon_site/registration/jinja2/registration/application.html +++ b/hackathon_site/registration/jinja2/registration/application.html @@ -15,8 +15,8 @@ display: block; width: 100%; margin-bottom: 0; - font-size: 0.8rem !important; - line-height: 1.4; + font-size: 1.1rem !important; + line-height: 1.5; white-space: normal; transform: none !important; } @@ -91,7 +91,7 @@

    Online Profiles

    Questions

    {{ render_field(form.how_many_hackathons, show_help_text_as_label=True, size="s12 select2-wrapper") }} - {{ render_field(form.past_hackathon_info, show_help_text_as_label=True) }} + {{ render_field(form.past_hackathon_info, show_help_text_as_label=True, label_above=True) }} {{ render_field(form.community_problem, show_help_text_as_label=True, label_above=True) }} {{ render_field(form.proud_project, show_help_text_as_label=True, label_above=True) }} {{ render_field(form.deadline_plan, show_help_text_as_label=True, label_above=True) }} diff --git a/hackathon_site/registration/migrations/0018_written_response_word_limit.py b/hackathon_site/registration/migrations/0018_written_response_word_limit.py new file mode 100644 index 0000000..76888d3 --- /dev/null +++ b/hackathon_site/registration/migrations/0018_written_response_word_limit.py @@ -0,0 +1,42 @@ +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("registration", "0017_auto_20261123_1432"), + ] + + operations = [ + migrations.AlterField( + model_name="application", + name="past_hackathon_info", + field=models.TextField( + default="", + help_text="If you've been to prior hackathon(s), please indicate the hackathon name, your project name and any prizes you won.", + ), + ), + migrations.AlterField( + model_name="application", + name="community_problem", + field=models.TextField( + default="", + help_text="What is one problem in your community or everyday life that you would like to solve through technology?", + ), + ), + migrations.AlterField( + model_name="application", + name="proud_project", + field=models.TextField( + default="", + help_text="Tell us a project that you have made in the past (technical or non-technical) that you are most proud of? What aspect of that project stood out to you?", + ), + ), + migrations.AlterField( + model_name="application", + name="deadline_plan", + field=models.TextField( + default="", + help_text="It’s 11 PM, and you have a project due at 11 AM tomorrow. Would you choose to stay up late or wake up early to finish it, and what would your plan be?", + ), + ), + ] diff --git a/hackathon_site/registration/models.py b/hackathon_site/registration/models.py index 4265c9c..d3e95c2 100644 --- a/hackathon_site/registration/models.py +++ b/hackathon_site/registration/models.py @@ -316,7 +316,6 @@ class Application(models.Model): null=False, default="", help_text="If you've been to prior hackathon(s), please indicate the hackathon name, your project name and any prizes you won.", - max_length=1000, ) what_past_experience = models.TextField( null=False, @@ -344,19 +343,16 @@ class Application(models.Model): null=False, default="", help_text="What is one problem in your community or everyday life that you would like to solve through technology?", - max_length=1000, ) proud_project = models.TextField( null=False, default="", help_text="Tell us a project that you have made in the past (technical or non-technical) that you are most proud of? What aspect of that project stood out to you?", - max_length=1000, ) deadline_plan = models.TextField( null=False, default="", help_text="It’s 11 PM, and you have a project due at 11 AM tomorrow. Would you choose to stay up late or wake up early to finish it, and what would your plan be?", - max_length=1000, ) discovery_method = models.TextField( null=False, diff --git a/hackathon_site/registration/test_forms.py b/hackathon_site/registration/test_forms.py index edfc84f..aefa1d5 100644 --- a/hackathon_site/registration/test_forms.py +++ b/hackathon_site/registration/test_forms.py @@ -216,6 +216,31 @@ def test_phone_number_regex(self): self.assertFalse(form.is_valid(), msg=number) self.assertIn("Enter a valid phone number.", form.errors["phone_number"]) + def test_written_response_word_limit(self): + written_responses = ( + "past_hackathon_info", + "community_problem", + "proud_project", + "deadline_plan", + ) + for field in written_responses: + with self.subTest(field=field): + data = self.data.copy() + data[field] = " " + "word\n" * 250 + form = self._build_form(data=data) + self.assertTrue(form.is_valid(), msg=form.errors) + + data[field] += "extra" + form = self._build_form(data=data) + self.assertFalse(form.is_valid()) + self.assertIn("Please use no more than 250 words.", form.errors[field]) + + def test_written_responses_can_exceed_old_character_limit(self): + data = self.data.copy() + data["community_problem"] = "longword " * 200 + form = self._build_form(data=data) + self.assertTrue(form.is_valid(), msg=form.errors) + def test_phone_number_clean_up(self): unclean_to_clean_numbers = ("+1 (123) 246-7890", "11232467890") From 334d0ebfa9c78d76b1cfe0598ae56ce740815672 Mon Sep 17 00:00:00 2001 From: Derek Date: Sat, 28 Nov 2026 18:18:45 -0500 Subject: [PATCH 6/6] feat: state when applications haven't opened yet --- hackathon_site/event/jinja2/event/landing.html | 2 +- hackathon_site/event/static/event/js/landing.js | 2 +- hackathon_site/hackathon_site/settings/__init__.py | 2 +- hackathon_site/hackathon_site/tests.py | 4 ++++ hackathon_site/hackathon_site/utils.py | 3 +++ .../registration/jinja2/registration/signup_closed.html | 5 ++++- hackathon_site/registration/test_views.py | 6 ++++++ 7 files changed, 20 insertions(+), 4 deletions(-) diff --git a/hackathon_site/event/jinja2/event/landing.html b/hackathon_site/event/jinja2/event/landing.html index 447d061..8ef8e0b 100644 --- a/hackathon_site/event/jinja2/event/landing.html +++ b/hackathon_site/event/jinja2/event/landing.html @@ -5,7 +5,7 @@ {% block head_extends %} diff --git a/hackathon_site/event/static/event/js/landing.js b/hackathon_site/event/static/event/js/landing.js index f9a0557..9ce03c4 100644 --- a/hackathon_site/event/static/event/js/landing.js +++ b/hackathon_site/event/static/event/js/landing.js @@ -79,7 +79,7 @@ $(document).ready(function () { } // Delete the entire countdown if event start date has passed - if (eventStartDate < now) { + if (registrationOpenDate === null || eventStartDate < now) { $("#countdown").remove(); $("#aboutText").removeClass("l7"); } else { diff --git a/hackathon_site/hackathon_site/settings/__init__.py b/hackathon_site/hackathon_site/settings/__init__.py index e33625c..43d7e90 100644 --- a/hackathon_site/hackathon_site/settings/__init__.py +++ b/hackathon_site/hackathon_site/settings/__init__.py @@ -318,7 +318,7 @@ CONTACT_EMAIL = DEFAULT_FROM_EMAIL HSS_ADMIN_EMAIL = "hardware@makeuoft.ca" -REGISTRATION_OPEN_DATE = datetime(2026, 11, 21, tzinfo=TZ_INFO) +REGISTRATION_OPEN_DATE = None REGISTRATION_CLOSE_DATE = datetime(2027, 1, 28, 23, 59, 0, tzinfo=TZ_INFO) EVENT_START_DATE = datetime(2026, 2, 14, 8, 0, 0, tzinfo=TZ_INFO) EVENT_END_DATE = datetime(2026, 2, 15, 17, 0, 0, tzinfo=TZ_INFO) diff --git a/hackathon_site/hackathon_site/tests.py b/hackathon_site/hackathon_site/tests.py index d59f4de..6672be9 100644 --- a/hackathon_site/hackathon_site/tests.py +++ b/hackathon_site/hackathon_site/tests.py @@ -193,6 +193,10 @@ def _make_event_profile(self, user=None, team=None): @override_settings(IN_TESTING=False) class IsRegistrationOpenTestCase(TestCase): + @override_settings(REGISTRATION_OPEN_DATE=None) + def test_no_opening_date(self): + self.assertFalse(is_registration_open()) + @override_settings( REGISTRATION_OPEN_DATE=datetime(2020, 1, 2, tzinfo=settings.TZ_INFO) ) diff --git a/hackathon_site/hackathon_site/utils.py b/hackathon_site/hackathon_site/utils.py index f31e9ff..cf8b2e7 100644 --- a/hackathon_site/hackathon_site/utils.py +++ b/hackathon_site/hackathon_site/utils.py @@ -34,6 +34,9 @@ def is_registration_open(): # So tests don't rely on the date, default to true return True + if settings.REGISTRATION_OPEN_DATE is None: + return False + # datetime.now() returns the system native time, so this assumes that the system timezone # is configured to match TIME_ZONE. We then make the datetime object timezone-aware. now = datetime.now().replace(tzinfo=settings.TZ_INFO) diff --git a/hackathon_site/registration/jinja2/registration/signup_closed.html b/hackathon_site/registration/jinja2/registration/signup_closed.html index 9cf7e8f..c65331f 100644 --- a/hackathon_site/registration/jinja2/registration/signup_closed.html +++ b/hackathon_site/registration/jinja2/registration/signup_closed.html @@ -8,7 +8,10 @@
    - {% if localtime(now()) < registration_open_date %} + {% if registration_open_date is none %} +

    Applications have not opened yet

    +

    The application opening date for {{ hackathon_name }} will be announced soon. Please check back!

    + {% elif localtime(now()) < registration_open_date %}

    Applications have not opened yet

    Applications for {{ hackathon_name }} will open on {{ localtime(registration_open_date)|strftime("%B %-d, %Y") }}. Please check back then!

    {% elif registration_open_date <= localtime(now()) < registration_close_date %} diff --git a/hackathon_site/registration/test_views.py b/hackathon_site/registration/test_views.py index 6571bf4..bbf3951 100644 --- a/hackathon_site/registration/test_views.py +++ b/hackathon_site/registration/test_views.py @@ -81,6 +81,12 @@ class SignUpClosedViewTestCase(TestCase): def setUp(self): self.view = reverse("registration:signup_closed") + @override_settings(REGISTRATION_OPEN_DATE=None) + def test_opening_date_not_announced(self): + response = self.client.get(self.view) + self.assertContains(response, "Applications have not opened yet") + self.assertContains(response, "will be announced soon") + @override_settings( REGISTRATION_OPEN_DATE=datetime(2020, 1, 2, tzinfo=settings.TZ_INFO) )