|
1 | | -# Copyright The IETF Trust 2009-2019, All Rights Reserved |
| 1 | +# Copyright The IETF Trust 2009-2020, All Rights Reserved |
2 | 2 | # -*- coding: utf-8 -*- |
3 | 3 | # |
4 | 4 | # Parts Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). |
|
55 | 55 |
|
56 | 56 | import debug # pyflakes:ignore |
57 | 57 |
|
58 | | -from ietf.doc.models import ( Document, DocAlias, DocHistory, DocEvent, BallotDocEvent, |
| 58 | +from ietf.doc.models import ( Document, DocAlias, DocHistory, DocEvent, BallotDocEvent, BallotType, |
59 | 59 | ConsensusDocEvent, NewRevisionDocEvent, TelechatDocEvent, WriteupDocEvent, IanaExpertDocEvent, |
60 | 60 | IESG_BALLOT_ACTIVE_STATES, STATUSCHANGE_RELATIONS ) |
61 | 61 | 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): |
86 | 86 | tabs = [] |
87 | 87 | tabs.append(("Status", "status", urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=name)), True, None)) |
88 | 88 |
|
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) |
90 | 92 | irsg_ballot = doc.latest_event(BallotDocEvent, type="created_ballot", ballot_type__slug='irsg-approve') |
91 | 93 |
|
92 | 94 | if doc.type_id == "draft" and doc.get_state("draft-stream-irtf"): |
@@ -1073,12 +1075,10 @@ def document_ballot(request, name, ballot_id=None): |
1073 | 1075 | if not ballot_id or not ballot: |
1074 | 1076 | raise Http404("Ballot not found for: %s" % name) |
1075 | 1077 |
|
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": |
1079 | 1079 | ballot_tab = "irsgballot" |
1080 | 1080 | else: |
1081 | | - ballot_tab = None |
| 1081 | + ballot_tab = "ballot" |
1082 | 1082 |
|
1083 | 1083 | top = render_document_top(request, doc, ballot_tab, name) |
1084 | 1084 |
|
|
0 commit comments