Skip to content

Commit 511006f

Browse files
committed
Fix error on Telechat doc detail page when conflict review doc has no ballot. Fixes ietf-tools#3245. Commit ready for merge.
- Legacy-Id: 19054
1 parent bfad845 commit 511006f

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

ietf/secr/telechat/tests.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
from django.urls import reverse
1111

12-
from ietf.doc.factories import WgDraftFactory, IndividualRfcFactory, CharterFactory
12+
from ietf.doc.factories import (WgDraftFactory, IndividualRfcFactory, CharterFactory,
13+
IndividualDraftFactory, ConflictReviewFactory)
1314
from ietf.doc.models import BallotDocEvent, BallotType, BallotPositionDocEvent, State, Document
1415
from ietf.doc.utils import update_telechat, create_ballot_if_not_open
1516
from ietf.utils.test_utils import TestCase
@@ -92,6 +93,18 @@ def test_doc_detail_draft_invalid(self):
9293
self.assertRedirects(response, reverse('ietf.secr.telechat.views.doc', kwargs={'date':date}))
9394
self.assertContains(response, 'not on the Telechat agenda')
9495

96+
def test_doc_detail_conflict_review_no_ballot(self):
97+
IndividualDraftFactory(name='draft-imaginary-independent-submission')
98+
review = ConflictReviewFactory(name='conflict-review-imaginary-irtf-submission',review_of=IndividualDraftFactory(name='draft-imaginary-irtf-submission',stream_id='irtf'),notify='notifyme@example.net')
99+
by=Person.objects.get(name="(System)")
100+
d = get_next_telechat_date()
101+
date = d.strftime('%Y-%m-%d')
102+
update_telechat(None, review, by, d)
103+
url = reverse('ietf.secr.telechat.views.doc_detail', kwargs={'date':date, 'name':review.name})
104+
self.client.login(username="secretary", password="secretary+password")
105+
response = self.client.get(url)
106+
self.assertEqual(response.status_code, 200)
107+
95108
def test_doc_detail_charter(self):
96109
by=Person.objects.get(name="(System)")
97110
charter = CharterFactory(states=[('charter','intrev')])

ietf/secr/telechat/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def doc_detail(request, date, name):
217217
if doc.active_ballot():
218218
ballot_type = doc.active_ballot().ballot_type
219219
else:
220-
ballot_type = BallotType.objects.get(doc_type='draft')
220+
ballot_type = BallotType.objects.get(doc_type=doc.type)
221221
BallotFormset = formset_factory(BallotForm, extra=0)
222222
BallotFormset.form.__init__ = curry(BallotForm.__init__, ballot_type=ballot_type)
223223

0 commit comments

Comments
 (0)