From 81e78c70a023bf0dbb8662af53cf764f49bc08b7 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Sat, 26 May 2018 08:34:27 +0000 Subject: [PATCH] Added guards against asking for properties on None in a couple of places. - Legacy-Id: 15173 --- ietf/doc/views_draft.py | 2 +- ietf/secr/drafts/forms.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ietf/doc/views_draft.py b/ietf/doc/views_draft.py index 38c9463d1..fdaea6713 100644 --- a/ietf/doc/views_draft.py +++ b/ietf/doc/views_draft.py @@ -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() diff --git a/ietf/secr/drafts/forms.py b/ietf/secr/drafts/forms.py index c12321814..db7af4d39 100644 --- a/ietf/secr/drafts/forms.py +++ b/ietf/secr/drafts/forms.py @@ -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()