Repository navigation
fix(admin): allow campaign finalization after ranking round is finali… - #672
Draft
SSpirate11 wants to merge 1 commit into
Draft
SSpirate11 wants to merge 1 commit into
SSpirate11 wants to merge 1 commit into
Conversation
Collaborator
|
Thank you for this. On #462 we agreed that the round's Finalize button only closes the round, with no results summary there. That part goes in through #683 (from #491). The rest of your approach is in #684, and you're a co-author of its commit:
The one difference: the summary is built when the campaign is finalized, not when the round is. Closing this one in favour of #684. Written by Claude (Claude Code) on behalf of @lgelauff. |
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.
Fixes #644
Fixes an issue where finalizing the last (ranking) round using the round's own "Finalize round" button makes the campaign impossible to close, locking coordinators out of the campaign report. Finalizing the ranking round directly now properly completes the round and generates the summary, and closing the campaign afterwards succeeds cleanly.
Changes done :
Added finalize_round() to properly finalize ranking and non-ranking rounds.
Idempotent summary (rdb.py): updated finalize_ranking_round() to update existing results summaries instead of creating duplicates.
Campaign endpoint (admin_endpoints.py): allowed finalize_campaign() to complete when the ranking round is already finalized.
Round endpoint (admin_endpoints.py): hooked finalize_round() into coord_dao.finalize_round() for complete round finalization.
Test coverage (test_web_basic.py): added integration tests for finalizing the ranking round before closing the campaign.
Working : When a coordinator clicks "Finalize round" on the ranking round, the round is marked finalized, its close date is recorded, and the campaign results summary is generated. When they subsequently click "Close campaign", the endpoint recognizes the already finalized ranking round, closes the campaign, and makes the campaign report immediately available (200 OK). Re-finalizing an already closed campaign returns a clean 400 Bad Request ("campaign is already finalized").