Skip to content

Commit 4fda60a

Browse files
committed
Merged in [8505] from rjsparks@nostrum.com:\n Allow removing a document shepherd, and test that it works. Fixes bug ietf-tools#1509.
- Legacy-Id: 8532 Note: SVN reference [8505] has been migrated to Git commit 0496ee1
2 parents cea2e8e + 0496ee1 commit 4fda60a

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

ietf/doc/tests_draft.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,8 +851,15 @@ def test_doc_change_shepherd(self):
851851
# save the form without changing the email (nothing should be saved)
852852
r = self.client.post(url, dict(shepherd=plain_email.pk))
853853
self.assertEqual(r.status_code, 302)
854+
self.doc = Document.objects.get(name=self.docname)
854855
self.assertEqual(set(comment_events), set(self.doc.docevent_set.filter(time=self.doc.time,type="added_comment")))
855856

857+
# Remove the shepherd
858+
r = self.client.post(url, dict(shepherd=''))
859+
self.assertEqual(r.status_code, 302)
860+
self.doc = Document.objects.get(name=self.docname)
861+
self.assertTrue(any(['Document shepherd changed to (None)' in x.desc for x in self.doc.docevent_set.filter(time=self.doc.time,type='added_comment')]))
862+
856863
# test buggy change
857864
ad = Person.objects.get(name='Aread Irector')
858865
two_answers = "%s,%s" % (plain_email, ad.email_set.all()[0])

ietf/doc/views_draft.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ def edit_shepherd(request, name):
968968
c.desc = "Document shepherd changed to "+ (doc.shepherd.person.name if doc.shepherd else "(None)")
969969
c.save()
970970

971-
if doc.shepherd.formatted_email() not in doc.notify:
971+
if doc.shepherd and (doc.shepherd.formatted_email() not in doc.notify):
972972
login = request.user.person
973973
addrs = doc.notify
974974
if addrs:

0 commit comments

Comments
 (0)