Skip to content

Commit 15d45b4

Browse files
committed
Changed the ballot_icon template tag to use an already found ballot if available, rather than doing lookups to find it (twice!).
- Legacy-Id: 15007
1 parent 1ec98fd commit 15d45b4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

ietf/doc/templatetags/ballot_icon.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ def ballot_icon(context, doc):
7373
if not showballoticon(doc):
7474
return ""
7575

76-
ballot = doc.active_ballot()
76+
ballot = doc.ballot if hasattr(doc, 'ballot') else doc.active_ballot()
77+
7778
if not ballot:
7879
return ""
7980

@@ -86,7 +87,7 @@ def sort_key(t):
8687
else:
8788
return (1, pos.pos.order)
8889

89-
positions = list(doc.active_ballot().active_ad_positions().items())
90+
positions = list(ballot.active_ad_positions().items())
9091
positions.sort(key=sort_key)
9192

9293
right_click_string = ''

0 commit comments

Comments
 (0)