Skip to content

Commit 2961f4d

Browse files
committed
Merged in [17173] from rjsparks@nostrum.com:
Works around a problem with displaying IESG evaluation information for non-approve ballot types. Partially addresses ietf-tools#2851. - Legacy-Id: 17183 Note: SVN reference [17173] has been migrated to Git commit 5773d62
2 parents 54a8b1d + 5773d62 commit 2961f4d

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

ietf/doc/templatetags/ballot_icon.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright The IETF Trust 2019, All Rights Reserved
1+
# Copyright The IETF Trust 2012-2020, All Rights Reserved
22
# Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
33
# All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
44
#
@@ -105,10 +105,10 @@ def sort_key(t):
105105
break
106106

107107
typename = "Unknown"
108-
if ballot.ballot_type.slug=='approve':
109-
typename = "IESG"
110-
elif ballot.ballot_type.slug=='irsg-approve':
108+
if ballot.ballot_type.slug=='irsg-approve':
111109
typename = "IRSG"
110+
else:
111+
typename = "IESG"
112112

113113
res = ['<a %s href="%s" data-toggle="modal" data-target="#modal-%d" title="%s positions (click to show more)" class="ballot-icon"><table' % (
114114
right_click_string,

ietf/doc/views_doc.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright The IETF Trust 2009-2019, All Rights Reserved
1+
# Copyright The IETF Trust 2009-2020, All Rights Reserved
22
# -*- coding: utf-8 -*-
33
#
44
# Parts Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
@@ -55,7 +55,7 @@
5555

5656
import debug # pyflakes:ignore
5757

58-
from ietf.doc.models import ( Document, DocAlias, DocHistory, DocEvent, BallotDocEvent,
58+
from ietf.doc.models import ( Document, DocAlias, DocHistory, DocEvent, BallotDocEvent, BallotType,
5959
ConsensusDocEvent, NewRevisionDocEvent, TelechatDocEvent, WriteupDocEvent, IanaExpertDocEvent,
6060
IESG_BALLOT_ACTIVE_STATES, STATUSCHANGE_RELATIONS )
6161
from ietf.doc.utils import (add_links_in_new_revision_events, augment_events_with_revision,
@@ -86,7 +86,9 @@ def render_document_top(request, doc, tab, name):
8686
tabs = []
8787
tabs.append(("Status", "status", urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=name)), True, None))
8888

89-
iesg_ballot = doc.latest_event(BallotDocEvent, type="created_ballot", ballot_type__slug='approve')
89+
iesg_type_slugs = set(BallotType.objects.values_list('slug',flat=True))
90+
iesg_type_slugs.discard('irsg-approve')
91+
iesg_ballot = doc.latest_event(BallotDocEvent, type="created_ballot", ballot_type__slug__in=iesg_type_slugs)
9092
irsg_ballot = doc.latest_event(BallotDocEvent, type="created_ballot", ballot_type__slug='irsg-approve')
9193

9294
if doc.type_id == "draft" and doc.get_state("draft-stream-irtf"):
@@ -1073,12 +1075,10 @@ def document_ballot(request, name, ballot_id=None):
10731075
if not ballot_id or not ballot:
10741076
raise Http404("Ballot not found for: %s" % name)
10751077

1076-
if ballot.ballot_type.slug == "approve":
1077-
ballot_tab = "ballot"
1078-
elif ballot.ballot_type.slug == "irsg-approve":
1078+
if ballot.ballot_type.slug == "irsg-approve":
10791079
ballot_tab = "irsgballot"
10801080
else:
1081-
ballot_tab = None
1081+
ballot_tab = "ballot"
10821082

10831083
top = render_document_top(request, doc, ballot_tab, name)
10841084

0 commit comments

Comments
 (0)