Repository navigation
Feature/team submission quota - #2701
Conversation
3b0a0f4 to
cd1bed9
Compare
|
@IdirLISN Can you add a banner or something that informs participants that the quota is shared between team members ? Right now, it's not really clear and can add confusion for participants |
cd1bed9 to
4284765
Compare
|
Not sure about this approach. My opinion:
|
1 - I disagree, having it be per phase can be interesting. You can have a phase that does not allow teams (therefor it's only individual quota) and a phase where teams are allowed. Especially now since we have parallel phases. Because of point 2, that would be impossible to do if the option was per competition instead of per phase 2 - I actually tried that, if you submit as a team OR individually, it will count for the quota of the whole team (which is why having an indicator that the option is active and that you are in a team is important) |
But is being part of an organization forced? Why join a team if it just reduce your quota? |
4284765 to
64f9cb2
Compare
8b0593b to
b254213
Compare
Original PR : #2683
Description
Adds an opt-in, per-phase team (organization) submission quota, requested by the organizers of EEG/EMG Challenge 2026. Today
max_submissions/max_submissions_per_dayapply per user, so a team of N members gets N× the sealed submissions.New field
Phase.max_submissions_scope:participant(default): current behavior. Migration0066adds the field with this default, so existing competitions are unchanged.organization: both limits are shared by all current members of each of the user's organizations.Team usage. Every submission in the phase whose owner is a current member of the organization (
Membership.ALL_GROUP, so pending invites don't count). This includes tagged and untagged submissions, so a member can't get around the team cap by submitting as themselves. The exclusion filters are the same as today: parent submissions only, no organizer re-submissions, noFailed.Enforcement. A user is blocked when any of their teams has reached either limit. The message names the team:
Team "<name>" has reached the maximum allowed submissions [for today] for this phase. The logic lives inPhase.can_user_make_submissions, so all three existing call sites pick it up unchanged:SubmissionCreationSerializer.validate, thecan_make_submissionendpoint andSubmission.save(). Users without a team keep individual limits and the existing messages. The daily cap is the same UTC calendar day as the individual limit.Edge cases (documented in
Yaml-Structure.md):Exposed in: both phase serializers, the v1/v2 YAML unpackers (optional key, default
participant; invalid values fail serializer validation), the competition YAML export (PHASE_FIELDS), the phase editor (Advanced → "Max Submissions Scope") and the docs:Badges. In organization-scoped phases, the submission-limit badges show team usage. For a user in several teams, they show the team closest to its limit.
Notes for reviewers
<select>, to keep the diff minimal. I'm happy to switch it to a Semantic UI dropdown like the rest of the editor.Pre-existing inconsistencies noticed (not changed here)
resubmitted_from, but enforcement does, so the badge over-reports after an organizer re-submission.Submission.re_run()copies skip the limit check when created, but then count toward the owner's quota afterwards. Re-Submit copies are excluded instead.unpacker_test_data.pyuses the keymax_submissions_per_person, but the unpackers readmax_submissions. The tests only pass because both defaults are 100.Issues this PR resolves
No existing issue. Requested by the organizers of EEG/EMG Challenge 2026.
A checklist for hand testing
participanttoo.GET /api/phases/<id>/returns"max_submissions_scope": "organization".max_submissions_scope: organizationimports correctly. An invalid value (e.g.team) fails the upload.max_submissions_scopeincompetition.yaml.The unticked items are covered by unit tests except export.
Tests run on the
docker composestack with.env_circleci, as in CircleCI:py.test src/: 455 passed, 2 skipped, 0 failed, including the 9 new testsflake8 src/: cleanmakemigrations --check --dry-run: no changesNew tests:
competitions/tests/test_submissions.py::TeamMaxSubmissionsTests(shared total across tagged and untagged submissions, daily cap, default scope unchanged, no-team fallback, user in two teams, invited users, badge counts) andtest_phase_max_submissions_scope_unpackingintest_v2_unpacker.py/test_v15_unpacker.py.Checklist