diff options
Diffstat (limited to 'archaeological_warehouse/forms.py')
-rw-r--r-- | archaeological_warehouse/forms.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py index 170edce1f..12e9f4949 100644 --- a/archaeological_warehouse/forms.py +++ b/archaeological_warehouse/forms.py @@ -308,6 +308,7 @@ class ContainerForm(CustomForm, ManageOldType, forms.Form): raise forms.ValidationError( _("The parent container is not attached to the same " "warehouse.")) + return self.cleaned_data["parent"] def clean(self): cleaned_data = self.cleaned_data @@ -343,10 +344,14 @@ class ContainerModifyForm(ContainerForm): super(ContainerModifyForm, self).__init__(*args, **kwargs) fields = OrderedDict() idx = self.fields.pop('index') + reordered = False for key, value in self.fields.items(): fields[key] = value if key == 'container_type': fields['index'] = idx + reordered = True + if not reordered: + fields['index'] = idx self.fields = fields def clean(self): |