diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-01-25 15:12:35 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:24 +0100 |
commit | 4001e44945a3ed6731a740ee84d0f52ba7719a63 (patch) | |
tree | b30300d7487f45632a9541f8948b014f78c0f21a /archaeological_warehouse/forms.py | |
parent | a582d1c634458ace4b15b4ca6a5be4a708e7e72c (diff) | |
download | Ishtar-4001e44945a3ed6731a740ee84d0f52ba7719a63.tar.bz2 Ishtar-4001e44945a3ed6731a740ee84d0f52ba7719a63.zip |
Container: fix container modification when no parent is defined
Diffstat (limited to 'archaeological_warehouse/forms.py')
-rw-r--r-- | archaeological_warehouse/forms.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py index b5a9b4391..b7724bd3d 100644 --- a/archaeological_warehouse/forms.py +++ b/archaeological_warehouse/forms.py @@ -338,7 +338,8 @@ class ContainerForm(CustomForm, ManageOldType, forms.Form): if q.count(): raise forms.ValidationError(_("This reference already exists for " "this warehouse.")) - if pk and pk == int(cleaned_data.get("parent")): + if pk and cleaned_data.get("parent", None) and pk == int( + cleaned_data.get("parent")): raise forms.ValidationError(_("A container cannot be a parent of " "himself.")) return cleaned_data |