fix: guard against KeyError (#8485)

This commit is contained in:
Jennifer Richards 2025-01-30 12:21:15 -04:00 committed by GitHub
parent d3bf0a37dc
commit da858725fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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