Works around a problem with displaying IESG evaluation information for non-approve ballot types. Partially addresses #2851. Commit ready for merge.

- Legacy-Id: 17173
This commit is contained in:
Robert Sparks 2019-12-23 19:48:21 +00:00
parent c13852df46
commit 5773d62c1b
2 changed files with 9 additions and 9 deletions

View file

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

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