diff options
Diffstat (limited to 'archaeological_operations')
-rw-r--r-- | archaeological_operations/forms.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 314e184e2..058e637f4 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -416,7 +416,9 @@ class RecordRelationsForm(ManageOldType, forms.Form): cleaned_data.get('right_record', None)): raise forms.ValidationError( _(u"You should select a relation type.")) - if str(cleaned_data.get('right_record')) == str(self.left_record.pk): + if self.left_record and \ + str(cleaned_data.get('right_record')) == str( + self.left_record.pk): raise forms.ValidationError( _(u"An operation cannot be related to herself.")) return cleaned_data |