Merged in [17173] from rjsparks@nostrum.com:

Works around a problem with displaying IESG evaluation information for non-approve ballot types. Partially addresses #2851.
 - Legacy-Id: 17183
Note: SVN reference [17173] has been migrated to Git commit 5773d62c1b
This commit is contained in:
Henrik Levkowetz 2020-01-06 18:48:33 +00:00
commit 2961f4dfba
2 changed files with 11 additions and 11 deletions

View file

@ -1,4 +1,4 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2012-2020, All Rights Reserved
# Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
#
@ -105,10 +105,10 @@ def ballot_icon(context, doc):
break
typename = "Unknown"
if ballot.ballot_type.slug=='approve':
typename = "IESG"
elif ballot.ballot_type.slug=='irsg-approve':
if ballot.ballot_type.slug=='irsg-approve':
typename = "IRSG"
else:
typename = "IESG"
res = ['<a %s href="%s" data-toggle="modal" data-target="#modal-%d" title="%s positions (click to show more)" class="ballot-icon"><table' % (
right_click_string,

View file

@ -1,4 +1,4 @@
# Copyright The IETF Trust 2009-2019, All Rights Reserved
# Copyright The IETF Trust 2009-2020, All Rights Reserved
# -*- coding: utf-8 -*-
#
# Parts Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
@ -55,7 +55,7 @@ from django import forms
import debug # pyflakes:ignore
from ietf.doc.models import ( Document, DocAlias, DocHistory, DocEvent, BallotDocEvent,
from ietf.doc.models import ( Document, DocAlias, DocHistory, DocEvent, BallotDocEvent, BallotType,
ConsensusDocEvent, NewRevisionDocEvent, TelechatDocEvent, WriteupDocEvent, IanaExpertDocEvent,
IESG_BALLOT_ACTIVE_STATES, STATUSCHANGE_RELATIONS )
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):
tabs = []
tabs.append(("Status", "status", urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=name)), True, None))
iesg_ballot = doc.latest_event(BallotDocEvent, type="created_ballot", ballot_type__slug='approve')
iesg_type_slugs = set(BallotType.objects.values_list('slug',flat=True))
iesg_type_slugs.discard('irsg-approve')
iesg_ballot = doc.latest_event(BallotDocEvent, type="created_ballot", ballot_type__slug__in=iesg_type_slugs)
irsg_ballot = doc.latest_event(BallotDocEvent, type="created_ballot", ballot_type__slug='irsg-approve')
if doc.type_id == "draft" and doc.get_state("draft-stream-irtf"):
@ -1073,12 +1075,10 @@ def document_ballot(request, name, ballot_id=None):
if not ballot_id or not ballot:
raise Http404("Ballot not found for: %s" % name)
if ballot.ballot_type.slug == "approve":
ballot_tab = "ballot"
elif ballot.ballot_type.slug == "irsg-approve":
if ballot.ballot_type.slug == "irsg-approve":
ballot_tab = "irsgballot"
else:
ballot_tab = None
ballot_tab = "ballot"
top = render_document_top(request, doc, ballot_tab, name)