Skip to content

Commit d2d13d7

Browse files
authored
Remove creator must be verified option (#4290)
Our challenges now require an algorithm phase so being verified is not optional.
1 parent 0b92d79 commit d2d13d7

12 files changed

Lines changed: 36 additions & 65 deletions

File tree

app/grandchallenge/challenges/models.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -782,13 +782,6 @@ def remove_admin(self, user):
782782
user.groups.remove(self.admins_group)
783783
unfollow(user=user, obj=self.discussion_forum, send_action=False)
784784

785-
@cached_property
786-
def should_show_verification_warning(self):
787-
for phase in self.visible_phases:
788-
if phase.creator_must_be_verified:
789-
return True
790-
return False
791-
792785
@cached_property
793786
def status(self) -> str:
794787
phase_status = {phase.status for phase in self.visible_phases}

app/grandchallenge/evaluation/forms.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from django.db.models import BooleanField, Case, Exists, OuterRef, When
1111
from django.db.transaction import on_commit
1212
from django.forms import (
13-
CheckboxInput,
1413
CheckboxSelectMultiple,
1514
Form,
1615
HiddenInput,
@@ -63,7 +62,6 @@
6362
"submissions_open_at",
6463
"submissions_close_at",
6564
"submission_page_markdown",
66-
"creator_must_be_verified",
6765
"submissions_limit_per_user_per_period",
6866
"submission_limit_period",
6967
"allow_submission_comments",
@@ -192,9 +190,6 @@ def __init__(self, *args, **kwargs):
192190
*algorithm_setting_options,
193191
)
194192
)
195-
self.fields["creator_must_be_verified"].widget = CheckboxInput(
196-
attrs={"checked": True}
197-
)
198193

199194
class Meta:
200195
model = Phase
@@ -568,7 +563,7 @@ def clean_creator(self):
568563
except ObjectDoesNotExist:
569564
user_is_verified = False
570565

571-
if self._phase.creator_must_be_verified and not user_is_verified:
566+
if not user_is_verified:
572567
error_message = format_html(
573568
"You must verify your account before you can make a "
574569
"submission to this phase. Please "
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Generated by Django 4.2.23 on 2025-09-05 11:26
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
(
10+
"evaluation",
11+
"0095_remove_phase_evaluation__challen_c9ad78_idx_and_more",
12+
),
13+
]
14+
15+
operations = [
16+
migrations.RemoveField(
17+
model_name="phase",
18+
name="creator_must_be_verified",
19+
),
20+
]

app/grandchallenge/evaluation/models.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -376,13 +376,6 @@ class Phase(FieldChangeMixin, HangingProtocolMixin, UUIDModel):
376376
default=ALL,
377377
help_text=("Which results should be displayed on the leaderboard?"),
378378
)
379-
creator_must_be_verified = models.BooleanField(
380-
default=False,
381-
help_text=(
382-
"If True, only participants with verified accounts can make "
383-
"submissions to this phase"
384-
),
385-
)
386379
submission_kind = models.PositiveSmallIntegerField(
387380
default=SubmissionKindChoices.CSV,
388381
choices=SubmissionKindChoices.choices,
@@ -797,11 +790,6 @@ def _clean_submission_kind(self):
797790

798791
def _clean_algorithm_submission_settings(self):
799792
if self.submission_kind == SubmissionKindChoices.ALGORITHM:
800-
if not self.creator_must_be_verified:
801-
raise ValidationError(
802-
"For phases that take an algorithm as submission input, "
803-
"the creator_must_be_verified box needs to be checked."
804-
)
805793
if (
806794
self.submissions_limit_per_user_per_period > 0
807795
and not self.external_evaluation

app/grandchallenge/evaluation/templates/evaluation/submission_form.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626
{% endblock %}
2727

2828
{% block content %}
29-
{% if phase.creator_must_be_verified %}
30-
{% include "challenges/partials/participant_verification_warning.html" %}
31-
{% endif %}
29+
{% include "challenges/partials/participant_verification_warning.html" %}
3230

3331
<h2>{{ phase.title }} Submission</h2>
3432

app/grandchallenge/evaluation/views/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,6 @@ def turn_phase_into_algorithm_phase(
11771177
)
11781178
phase.archive = archive
11791179
phase.submission_kind = phase.SubmissionKindChoices.ALGORITHM
1180-
phase.creator_must_be_verified = True
11811180
phase.save()
11821181

11831182

app/grandchallenge/pages/templates/pages/page_detail.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
{% block content %}
5757
<div class="ml-lg-3">
58-
{% if challenge.should_show_verification_warning and user_is_participant %}
58+
{% if user_is_participant %}
5959
{% include "challenges/partials/participant_verification_warning.html" %}
6060
{% endif %}
6161

app/tests/evaluation_tests/test_forms.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ def test_algorithm_no_permission(self):
415415

416416
def test_algorithm_with_permission(self):
417417
user = UserFactory()
418+
VerificationFactory(user=user, is_verified=True)
418419
alg = AlgorithmFactory()
419420
alg.add_editor(user=user)
420421
ci1 = ComponentInterfaceFactory()
@@ -473,6 +474,7 @@ def test_algorithm_with_permission(self):
473474

474475
def test_algorithm_image_and_model_set(self):
475476
user = UserFactory()
477+
VerificationFactory(user=user, is_verified=True)
476478
alg = AlgorithmFactory()
477479
alg.add_editor(user=user)
478480
ci1 = ComponentInterfaceFactory()
@@ -535,7 +537,7 @@ def test_user_no_verification(self):
535537

536538
form = SubmissionForm(
537539
user=user,
538-
phase=PhaseFactory(creator_must_be_verified=True),
540+
phase=PhaseFactory(),
539541
data={"creator": user},
540542
)
541543

@@ -552,7 +554,6 @@ def test_user_with_verification(self, is_verified):
552554
VerificationFactory(user=user, is_verified=is_verified)
553555

554556
phase = PhaseFactory(
555-
creator_must_be_verified=True,
556557
submissions_limit_per_user_per_period=10,
557558
)
558559
InvoiceFactory(
@@ -574,6 +575,7 @@ def test_user_with_verification(self, is_verified):
574575

575576
def test_no_valid_archive_items(self):
576577
user = UserFactory()
578+
VerificationFactory(user=user, is_verified=True)
577579
p_pred = PhaseFactory(
578580
submission_kind=SubmissionKindChoices.CSV,
579581
submissions_limit_per_user_per_period=10,
@@ -777,6 +779,7 @@ def test_eval_exists_for_image_and_model(
777779
self, model_active, submission_with_model_present, form_is_valid
778780
):
779781
user = UserFactory()
782+
VerificationFactory(user=user, is_verified=True)
780783
alg = AlgorithmFactory()
781784
alg.add_editor(user=user)
782785
ci1 = ComponentInterfaceFactory()

app/tests/evaluation_tests/test_models.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,6 @@ def test_email_sent_to_editors_when_permissions_enabled():
998998
@pytest.mark.django_db
999999
def test_give_algorithm_editors_job_view_permissions_only_for_algorithm_phase():
10001000
phase = PhaseFactory(
1001-
creator_must_be_verified=True,
10021001
submission_kind=Phase.SubmissionKindChoices.CSV,
10031002
give_algorithm_editors_job_view_permissions=False,
10041003
)
@@ -1071,9 +1070,7 @@ def test_parent_phase_choices_no_circular_dependency():
10711070

10721071
@pytest.mark.django_db
10731072
def test_clean_parent_phase():
1074-
p1, p2, p3, p4 = PhaseFactory.create_batch(
1075-
4, challenge=ChallengeFactory(), creator_must_be_verified=True
1076-
)
1073+
p1, p2, p3, p4 = PhaseFactory.create_batch(4, challenge=ChallengeFactory())
10771074
ci1, ci2 = ComponentInterfaceFactory.create_batch(2)
10781075
interface = AlgorithmInterfaceFactory(inputs=[ci1], outputs=[ci2])
10791076

app/tests/evaluation_tests/test_tasks.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
create_upload_from_file,
4949
)
5050
from tests.utils import get_view_for_user, recurse_callbacks
51+
from tests.verification_tests.factories import VerificationFactory
5152

5253

5354
@pytest.mark.django_db
@@ -85,6 +86,7 @@ def test_submission_evaluation(
8586
)
8687

8788
participant = UserFactory()
89+
VerificationFactory(user=participant, is_verified=True)
8890
phase.challenge.add_participant(user=participant)
8991

9092
user_upload = create_upload_from_file(
@@ -581,6 +583,7 @@ def test_non_zip_submission_failure(
581583
)
582584

583585
participant = UserFactory()
586+
VerificationFactory(user=participant, is_verified=True)
584587
phase.challenge.add_participant(user=participant)
585588

586589
user_upload = create_upload_from_file(
@@ -652,6 +655,7 @@ def test_evaluation_notifications(
652655
)
653656

654657
participant = UserFactory()
658+
VerificationFactory(user=participant, is_verified=True)
655659
phase.challenge.add_participant(user=participant)
656660

657661
user_upload = create_upload_from_file(
@@ -868,6 +872,7 @@ def test_evaluation_time_limit_set(
868872
)
869873

870874
participant = UserFactory()
875+
VerificationFactory(user=participant, is_verified=True)
871876
phase.challenge.add_participant(user=participant)
872877

873878
user_upload = create_completed_upload(user=participant)

0 commit comments

Comments
 (0)