Skip to content

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

@userAdityaa

Description

@userAdityaa

Description:

The finalize_round endpoint at admin_endpoints.py sets rnd.status = FINALIZED_STATUS directly on the ORM object instead of calling the proper DAO methods (finalize_rating_round or finalize_ranking_round). This means:

  • close_date is never set on the round
  • Update status to finalized
  • No audit log entry is created

Steps to Reproduce:

  1. Create a campaign, add a round, activate it, and complete all voting
  2. Finalize the round via the endpoint
  3. Check the round's close_date in the database, it is NULL
  4. Check the audit log, no finalize_round entry exists

Expected Behavior

Finalizing a round should perform all required finalization actions, including:

  • Set close_date to the current timestamp
  • Create an audit log entry for the finalization action
  • For ranking rounds: create a RoundResultsSummary
  • For rating rounds: store the final_threshold in the configuration

Actual Behavior

Only the status field is changed. All other finalization side-effects are skipped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions