Fix Telechat app bug, draft with no ballot. Commit ready for merge
- Legacy-Id: 19180
This commit is contained in:
parent
2ad9313589
commit
d216a18734
|
@ -105,6 +105,17 @@ class SecrTelechatTestCase(TestCase):
|
||||||
response = self.client.get(url)
|
response = self.client.get(url)
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
|
def test_doc_detail_draft_no_ballot(self):
|
||||||
|
draft = IndividualDraftFactory(name='draft-imaginary-independent-submission')
|
||||||
|
by=Person.objects.get(name="(System)")
|
||||||
|
d = get_next_telechat_date()
|
||||||
|
date = d.strftime('%Y-%m-%d')
|
||||||
|
update_telechat(None, draft, by, d)
|
||||||
|
url = reverse('ietf.secr.telechat.views.doc_detail', kwargs={'date':date, 'name':draft.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):
|
def test_doc_detail_charter(self):
|
||||||
by=Person.objects.get(name="(System)")
|
by=Person.objects.get(name="(System)")
|
||||||
charter = CharterFactory(states=[('charter','intrev')])
|
charter = CharterFactory(states=[('charter','intrev')])
|
||||||
|
|
|
@ -216,6 +216,8 @@ def doc_detail(request, date, name):
|
||||||
# need to use curry here to pass custom variable to form init
|
# need to use curry here to pass custom variable to form init
|
||||||
if doc.active_ballot():
|
if doc.active_ballot():
|
||||||
ballot_type = doc.active_ballot().ballot_type
|
ballot_type = doc.active_ballot().ballot_type
|
||||||
|
elif doc.type.slug == 'draft':
|
||||||
|
ballot_type = BallotType.objects.get(doc_type__slug='draft', slug='approve')
|
||||||
else:
|
else:
|
||||||
ballot_type = BallotType.objects.get(doc_type=doc.type)
|
ballot_type = BallotType.objects.get(doc_type=doc.type)
|
||||||
BallotFormset = formset_factory(BallotForm, extra=0)
|
BallotFormset = formset_factory(BallotForm, extra=0)
|
||||||
|
|
Loading…
Reference in a new issue