Skip to content

fix(admin): finalize a round through the DAO (close date, audit log, status check) - #683

Open
lgelauff wants to merge 4 commits into
masterfrom
fix/491-finalize-round-dao
Open

lgelauff wants to merge 4 commits into
masterfrom
fix/491-finalize-round-dao

Conversation

@lgelauff

Copy link
Copy Markdown
Collaborator

The round's Finalize button (POST /admin/round/<id>/finalize) set status directly on the round, so close_date stayed empty and no audit entry was written (#462).

This is @userAdityaa's change from #491. Their commit is kept as is, rebased onto current master (the only conflict was where the new method goes). Thank you for the fix and for the regression test.

Changes

Notes

  • Rounds finalized with the button before this change keep an empty close_date. Only the display reads it, and it can't be backfilled, because no audit entry was written then.
  • The audit action name finalize_round is also what finalize_rating_round logs.

Tests

test_finalize_round_sets_close_date_and_logs_action covers the close date, exactly one audit entry, the refused second finalize and the refused cancelled round. It fails without the change. Full suite: 172 passed, 3 xfailed.

Closes #462. Supersedes #491.

Written by Claude (Claude Code) on behalf of @lgelauff.

🤖 Generated with Claude Code

userAdityaa and others added 4 commits October 31, 2026 17:06
- finalize_round: use timezone-aware now() like the rest of rdb.py;
  datetime.utcnow() is deprecated on Python 3.12+.
- test: import through the two-step checked import (#510); the
  one-step call now returns 400 without a check_token.

Refs #462, #491

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
finalize_round now writes close_date, so finalizing a cancelled round
overwrote its cancel date and relabelled it finalized, and finalizing
twice rewrote close_date and logged a second entry. Refuse both with
InvalidAction, add a docstring stating the #462 scope (no threshold,
no results summary), and test both refusals.

Refs #462, #491

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#491 dropped it because finalize_round no longer uses it, but the
follow-up for #644 uses it in finalize_campaign. The two branches merge
without a conflict and then fail with a NameError (500 on campaign
finalize). Keeping the import leaves the import block as on master.

Refs #491, #644

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: finalize_round endpoint bypasses DAO finalization logic (missing close_date, audit log)

2 participants