Skip to content

fix: check correct state machine when clearing status change ballots#7684

Merged
rjsparks merged 4 commits intoietf-tools:mainfrom
rjsparks:clear_statchg_ballot
Jul 15, 2024
Merged

fix: check correct state machine when clearing status change ballots#7684
rjsparks merged 4 commits intoietf-tools:mainfrom
rjsparks:clear_statchg_ballot

Conversation

@rjsparks
Copy link
Member

Fixes #7335

if close_ballot(doc, by, ballot_type_slug):
create_ballot_if_not_open(request, doc, by, ballot_type_slug)
if doc.get_state('draft-iesg').slug == 'defer':
if doc.get_state("statchg").slug == "defer":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shoul have a guard against doc.get_state() returning None. (I think this is the cause of the failing test)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm - that just exposes another subtle bug - the check should be against the ballot_type_slug, and if there is no state, the view had best do nothing (404 would be right I think).

@codecov
Copy link

codecov bot commented Jul 15, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.

Project coverage is 88.79%. Comparing base (187c2c5) to head (080f5a8).
Report is 317 commits behind head on main.

Files Patch % Lines
ietf/doc/views_ballot.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7684      +/-   ##
==========================================
- Coverage   88.98%   88.79%   -0.20%     
==========================================
  Files         291      296       +5     
  Lines       40717    41318     +601     
==========================================
+ Hits        36233    36687     +454     
- Misses       4484     4631     +147     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rjsparks rjsparks merged commit 17e0f57 into ietf-tools:main Jul 15, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 19, 2024
@rjsparks rjsparks deleted the clear_statchg_ballot branch September 16, 2024 13:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Attempts to clear a status change ballots crash

2 participants