Fix error on Telechat doc detail page when conflict review doc has no ballot. Fixes #3245. Commit ready for merge.

- Legacy-Id: 19054
This commit is contained in:
Ryan Cross 2021-06-01 22:32:45 +00:00
parent bfad845662
commit 511006fe8e
2 changed files with 15 additions and 2 deletions

View file

@ -9,7 +9,8 @@ import debug # pyflakes:ignore
from django.urls import reverse
from ietf.doc.factories import WgDraftFactory, IndividualRfcFactory, CharterFactory
from ietf.doc.factories import (WgDraftFactory, IndividualRfcFactory, CharterFactory,
IndividualDraftFactory, ConflictReviewFactory)
from ietf.doc.models import BallotDocEvent, BallotType, BallotPositionDocEvent, State, Document
from ietf.doc.utils import update_telechat, create_ballot_if_not_open
from ietf.utils.test_utils import TestCase
@ -92,6 +93,18 @@ class SecrTelechatTestCase(TestCase):
self.assertRedirects(response, reverse('ietf.secr.telechat.views.doc', kwargs={'date':date}))
self.assertContains(response, 'not on the Telechat agenda')
def test_doc_detail_conflict_review_no_ballot(self):
IndividualDraftFactory(name='draft-imaginary-independent-submission')
review = ConflictReviewFactory(name='conflict-review-imaginary-irtf-submission',review_of=IndividualDraftFactory(name='draft-imaginary-irtf-submission',stream_id='irtf'),notify='notifyme@example.net')
by=Person.objects.get(name="(System)")
d = get_next_telechat_date()
date = d.strftime('%Y-%m-%d')
update_telechat(None, review, by, d)
url = reverse('ietf.secr.telechat.views.doc_detail', kwargs={'date':date, 'name':review.name})
self.client.login(username="secretary", password="secretary+password")
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
def test_doc_detail_charter(self):
by=Person.objects.get(name="(System)")
charter = CharterFactory(states=[('charter','intrev')])

View file

@ -217,7 +217,7 @@ def doc_detail(request, date, name):
if doc.active_ballot():
ballot_type = doc.active_ballot().ballot_type
else:
ballot_type = BallotType.objects.get(doc_type='draft')
ballot_type = BallotType.objects.get(doc_type=doc.type)
BallotFormset = formset_factory(BallotForm, extra=0)
BallotFormset.form.__init__ = curry(BallotForm.__init__, ballot_type=ballot_type)