From 5f5d81fd90d081117537bb055671c0d86ffad999 Mon Sep 17 00:00:00 2001 From: James Meakin <12661555+jmsmkn@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:57:26 +0100 Subject: [PATCH 1/2] Removes oninput for challenge request form The old functionality was to drop invalid values, this does not seem user friendly. Now, we use the default behavioud of the browser forcing the user to fill in a valid value when they try to submit the form instead. Closes #3748 --- app/grandchallenge/challenges/forms.py | 27 ------------------- ...thm_maximum_settable_memory_gb_and_more.py | 1 - app/grandchallenge/challenges/models.py | 1 - 3 files changed, 29 deletions(-) diff --git a/app/grandchallenge/challenges/forms.py b/app/grandchallenge/challenges/forms.py index 133ccbf1f..4c5084634 100644 --- a/app/grandchallenge/challenges/forms.py +++ b/app/grandchallenge/challenges/forms.py @@ -193,33 +193,6 @@ class Meta: widgets = { "start_date": forms.TextInput(attrs={"type": "date"}), "end_date": forms.TextInput(attrs={"type": "date"}), - "expected_number_of_teams": forms.NumberInput( - attrs={"oninput": "validity.valid||(value='');"} - ), - "number_of_tasks": forms.NumberInput( - attrs={"oninput": "validity.valid||(value='');"} - ), - "average_size_of_test_image_in_mb": forms.NumberInput( - attrs={"oninput": "validity.valid||(value='');"} - ), - "inference_time_limit_in_minutes": forms.NumberInput( - attrs={"oninput": "validity.valid||(value='');"} - ), - "phase_1_number_of_submissions_per_team": forms.NumberInput( - attrs={"oninput": "validity.valid||(value='');"} - ), - "phase_2_number_of_submissions_per_team": forms.NumberInput( - attrs={"oninput": "validity.valid||(value='');"} - ), - "phase_1_number_of_test_images": forms.NumberInput( - attrs={"oninput": "validity.valid||(value='');"} - ), - "phase_2_number_of_test_images": forms.NumberInput( - attrs={"oninput": "validity.valid||(value='');"} - ), - "budget_for_hosting_challenge": forms.NumberInput( - attrs={"oninput": "validity.valid||(value='');"} - ), } labels = { "short_name": "Acronym", diff --git a/app/grandchallenge/challenges/migrations/0045_challengerequest_algorithm_maximum_settable_memory_gb_and_more.py b/app/grandchallenge/challenges/migrations/0045_challengerequest_algorithm_maximum_settable_memory_gb_and_more.py index 491519e02..7900d3e76 100644 --- a/app/grandchallenge/challenges/migrations/0045_challengerequest_algorithm_maximum_settable_memory_gb_and_more.py +++ b/app/grandchallenge/challenges/migrations/0045_challengerequest_algorithm_maximum_settable_memory_gb_and_more.py @@ -81,7 +81,6 @@ class Migration(migrations.Migration): model_name="challengerequest", name="budget_for_hosting_challenge", field=models.PositiveIntegerField( - default=0, help_text="What is your budget for hosting this challenge? Please be reminded of our challenge pricing policy.", ), ), diff --git a/app/grandchallenge/challenges/models.py b/app/grandchallenge/challenges/models.py index 2b7fdc49c..fcc745942 100644 --- a/app/grandchallenge/challenges/models.py +++ b/app/grandchallenge/challenges/models.py @@ -951,7 +951,6 @@ class ChallengeRequestStatusChoices(models.TextChoices): validators=[MinValueValidator(limit_value=1)], ) budget_for_hosting_challenge = models.PositiveIntegerField( - default=0, help_text="What is your budget for hosting this challenge? Please be reminded of our challenge pricing policy.", ) long_term_commitment = models.BooleanField( From 08fdc278a944da78e45ff8270b60aea17cf6534a Mon Sep 17 00:00:00 2001 From: James Meakin <12661555+jmsmkn@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:19:21 +0100 Subject: [PATCH 2/2] Set default on factory --- app/tests/factories.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app/tests/factories.py b/app/tests/factories.py index 455ce4301..0bdefae2f 100644 --- a/app/tests/factories.py +++ b/app/tests/factories.py @@ -115,6 +115,7 @@ class Meta: phase_1_number_of_test_images = 100 phase_2_number_of_test_images = 0 number_of_tasks = 1 + budget_for_hosting_challenge = 0 structured_challenge_submission_doi = "10.5281/zenodo.6362337"