Repository navigation
Conversation
New Phase.max_submissions_scope field ('participant' default, 'organization').
With 'organization', max_submissions_per_person and max_submissions_per_day
are shared by all current (non-invited) members of each of the user's
organizations, counting tagged and untagged submissions. A user is blocked
when any of their teams is full; users without a team keep individual limits.
The field is exposed in the phase serializers, the v1/v2 YAML unpackers
(optional key), the competition YAML export, the phase editor and the docs.
The submission limit badges show team usage for organization-scoped phases.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Ukqzbbc6mAQxHhfWygTcN
15 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A brief description of the purpose of the changes contained in this PR.
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