Skip to content

Commit

Permalink
Removes oninput for challenge request form (#3751)
Browse files Browse the repository at this point in the history
The old functionality was to drop invalid values, this does not seem
user friendly. Now, we use the default behaviour of the browser forcing
the user to fill in a valid value when they try to submit the form
instead.

This also removes the budget default of zero which prevents the
requester overlooking the field.

Closes #3748
  • Loading branch information
jmsmkn authored Dec 13, 2024
1 parent af782e5 commit 0782236
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 29 deletions.
27 changes: 0 additions & 27 deletions app/grandchallenge/challenges/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href='/challenge-policy-and-pricing/'>challenge pricing policy</a>.",
),
),
Expand Down
1 change: 0 additions & 1 deletion app/grandchallenge/challenges/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href='/challenge-policy-and-pricing/'>challenge pricing policy</a>.",
)
long_term_commitment = models.BooleanField(
Expand Down
1 change: 1 addition & 0 deletions app/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand Down

0 comments on commit 0782236

Please sign in to comment.