Added guards against asking for properties on None in a couple of places.

- Legacy-Id: 15173
This commit is contained in:
Henrik Levkowetz 2018-05-26 08:34:27 +00:00
parent 2522082979
commit 81e78c70a0
2 changed files with 2 additions and 2 deletions

View file

@ -954,7 +954,7 @@ def edit_shepherd(request, name):
events = []
doc.shepherd = form.cleaned_data['shepherd']
if not doc.shepherd.origin:
if doc.shepherd and not doc.shepherd.origin:
doc.shepherd.origin = 'shepherd: %s' % doc.name
doc.shepherd.save()

View file

@ -180,7 +180,7 @@ class EditModelForm(forms.ModelForm):
if 'shepherd' in self.changed_data:
email = self.cleaned_data.get('shepherd')
if not email.origin:
if email and not email.origin:
email.origin = 'shepherd: %s' % m.name
email.save()