Merged in [8505] from rjsparks@nostrum.com:\n Allow removing a document shepherd, and test that it works. Fixes bug #1509.
- Legacy-Id: 8532
Note: SVN reference [8505] has been migrated to Git commit 0496ee1b73
This commit is contained in:
commit
4fda60a42a
|
@ -851,8 +851,15 @@ class IndividualInfoFormsTests(TestCase):
|
|||
# save the form without changing the email (nothing should be saved)
|
||||
r = self.client.post(url, dict(shepherd=plain_email.pk))
|
||||
self.assertEqual(r.status_code, 302)
|
||||
self.doc = Document.objects.get(name=self.docname)
|
||||
self.assertEqual(set(comment_events), set(self.doc.docevent_set.filter(time=self.doc.time,type="added_comment")))
|
||||
|
||||
# Remove the shepherd
|
||||
r = self.client.post(url, dict(shepherd=''))
|
||||
self.assertEqual(r.status_code, 302)
|
||||
self.doc = Document.objects.get(name=self.docname)
|
||||
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')]))
|
||||
|
||||
# test buggy change
|
||||
ad = Person.objects.get(name='Aread Irector')
|
||||
two_answers = "%s,%s" % (plain_email, ad.email_set.all()[0])
|
||||
|
|
|
@ -968,7 +968,7 @@ def edit_shepherd(request, name):
|
|||
c.desc = "Document shepherd changed to "+ (doc.shepherd.person.name if doc.shepherd else "(None)")
|
||||
c.save()
|
||||
|
||||
if doc.shepherd.formatted_email() not in doc.notify:
|
||||
if doc.shepherd and (doc.shepherd.formatted_email() not in doc.notify):
|
||||
login = request.user.person
|
||||
addrs = doc.notify
|
||||
if addrs:
|
||||
|
|
Loading…
Reference in a new issue