feat: stickers v2 & my submission overview#63
Open
FelyCZ wants to merge 31 commits into
Open
Conversation
modified: assets/sass/components/stickers.scss new file: ksicht/core/sticker_utils.py modified: ksicht/core/stickers/engine.py new file: ksicht/core/stickers/services.py modified: ksicht/core/templates/core/includes/sticker.html modified: ksicht/core/templates/core/manage/series_detail.html modified: ksicht/core/templates/core/manage/sticker_assignment_overview.html modified: ksicht/core/templatetags/stickers.py modified: ksicht/core/views/series.py new file: tests/test_core/test_sticker_assignment_limit.py new file: tests/test_core/test_sticker_services.py
modified: ksicht/core/models.py
modified: assets/sass/components/stickers.scss new file: ksicht/core/sticker_utils.py modified: ksicht/core/stickers/engine.py new file: ksicht/core/stickers/services.py modified: ksicht/core/templates/core/includes/sticker.html modified: ksicht/core/templates/core/manage/series_detail.html modified: ksicht/core/templates/core/manage/sticker_assignment_overview.html modified: ksicht/core/templatetags/stickers.py modified: ksicht/core/views/series.py new file: tests/test_core/test_sticker_assignment_limit.py new file: tests/test_core/test_sticker_services.py
modified: ksicht/core/models.py
…-org/ksicht into feat/stickers-improvement-stacked
antivirak
reviewed
Mar 19, 2026
antivirak
left a comment
There was a problem hiding this comment.
Did not test the changes, did not go into deep details, just some minor suggestions
Member
Author
|
Many thanks for the review, @antivirak! |
antivirak
reviewed
Mar 19, 2026
| } | ||
|
|
||
| # Fetch all assignments for this participant | ||
| all_assignments = list(StickerAssignment.objects.filter( |
There was a problem hiding this comment.
This query can be moved up outside of the for loop - participant is not dependent on current application iteration
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.
Objective
This PR introduces the ability to limit sticker assignments (e.g., "Once per grade" or "Once in a lifetime") and adds a new "My Submissions" overview page for participants. It also includes several optimizations for the sticker engine and ranking calculations, as well as minor bug fixes and dependency updates.
Key Features & Changes
1. Sticker Assignment Limits
assignment_limitfield to theStickermodel with choices:UNLIMITED,ONCE_PER_GRADE, andONCE_IN_LIFETIME.TaskSolutionSubmission.stickers) to explicitStickerAssignmenttracking.StickerAssignmentto enforce uniqueness per series/submission/event based on the context.ScoringFormby replacingModelMultipleChoiceFieldwith aTypedMultipleChoiceFieldto eliminate N+1 query problems during validation.save()method inScoringFormto correctly create/updateStickerAssignmentinstances with the proper series and timing context._grade_detailsinksicht/core/stickers/engine.pyto pre-calculate max scores and group queries in-memory for bulk processing.fixtures/stickers.jsonto assign limits to all existing stickers (e.g., "Poslední zvonění" is nowonce_in_lifetime, "Řešitel" isonce_per_grade). This need further review later.2. My Submissions View
ksicht/core/views/submissions.py), and a new template (my_submissions.html).3. UI/UX & Bug Fixes
stickers.scss.Testing & Verification
tests/test_core/test_sticker_assignment_limit.pytests/test_core/test_sticker_services.pyUsage/Deployment Notes
StickerandStickerAssignment. You will need to runpython manage.py migrateafter checkout.fixtures/stickers.jsonhas been modified; consider reloading fixtures if testing on a fresh database.