fix: guard against KeyError (#8485)
This commit is contained in:
parent
d3bf0a37dc
commit
da858725fd
|
@ -33,7 +33,7 @@ def telechat_page_count(date=None, docs=None, ad=None):
|
|||
ballot = draft.active_ballot()
|
||||
if ballot:
|
||||
positions = ballot.active_balloter_positions()
|
||||
ad_position = positions[ad]
|
||||
ad_position = positions.get(ad, None)
|
||||
if ad_position is None or ad_position.pos_id == "norecord":
|
||||
ad_pages_left_to_ballot_on += draft.pages or 0
|
||||
|
||||
|
|
Loading…
Reference in a new issue