Merged [2490] from olau@. Fixes issue #364.
- Legacy-Id: 2493 Note: SVN reference [2490] has been migrated to Git commit 860041df216ae6b11e059e37c96b64eae45de0ff
This commit is contained in:
parent
c0884bbbcf
commit
0818e58ddf
|
@ -365,7 +365,16 @@ class EditPositionTestCase(django.test.TestCase):
|
|||
self.assertTrue(pos.discuss == -1)
|
||||
self.assertEquals(draft.idinternal.comments().count(), comments_before + 1)
|
||||
self.assertTrue("Position" in draft.idinternal.comments()[0].comment_text)
|
||||
|
||||
# clear vote
|
||||
comments_before = draft.idinternal.comments().count()
|
||||
r = self.client.post(url, dict(position=""))
|
||||
self.assertEquals(r.status_code, 302)
|
||||
|
||||
pos = Position.objects.filter(ballot=draft.idinternal.ballot, ad__login_name="rhousley")
|
||||
self.assertEquals(len(pos), 0)
|
||||
self.assertEquals(draft.idinternal.comments().count(), comments_before + 1)
|
||||
self.assertTrue("Position" in draft.idinternal.comments()[0].comment_text)
|
||||
def test_edit_position_as_secretary(self):
|
||||
draft = InternetDraft.objects.get(filename="draft-ietf-mipshop-pfmipv6")
|
||||
url = urlreverse('doc_edit_position', kwargs=dict(name=draft.filename))
|
||||
|
|
|
@ -52,7 +52,7 @@ def get_ballot_info(ballot, area_director):
|
|||
return (pos, discuss, comment)
|
||||
|
||||
class EditPositionForm(forms.Form):
|
||||
position = forms.ChoiceField(choices=BALLOT_CHOICES, widget=forms.RadioSelect)
|
||||
position = forms.ChoiceField(choices=BALLOT_CHOICES, widget=forms.RadioSelect, required=False)
|
||||
discuss_text = forms.CharField(required=False, widget=forms.Textarea)
|
||||
comment_text = forms.CharField(required=False, widget=forms.Textarea)
|
||||
|
||||
|
@ -95,7 +95,10 @@ def edit_position(request, name):
|
|||
setattr(pos, vote, 1)
|
||||
|
||||
if pos.id:
|
||||
pos.save()
|
||||
if vote:
|
||||
pos.save()
|
||||
else:
|
||||
pos.delete()
|
||||
if vote != old_vote:
|
||||
add_document_comment(request, doc, "[Ballot Position Update] Position for %s has been changed to %s from %s" % (pos.ad, position_label(vote), position_label(old_vote)))
|
||||
elif vote:
|
||||
|
|
Loading…
Reference in a new issue