diff options
Diffstat (limited to 'archaeological_warehouse/forms.py')
| -rw-r--r-- | archaeological_warehouse/forms.py | 7 | 
1 files changed, 7 insertions, 0 deletions
| diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py index b7724bd3d..c5720390a 100644 --- a/archaeological_warehouse/forms.py +++ b/archaeological_warehouse/forms.py @@ -378,6 +378,13 @@ class ContainerModifyForm(ContainerForm):      def clean(self):          # manage unique ID          cleaned_data = super(ContainerModifyForm, self).clean() +        container_type = cleaned_data.get("container_type", None) +        try: +            container_type = models.ContainerType.objects.get(pk=container_type) +        except models.ContainerType.DoesNotExist: +            return cleaned_data +        if container_type.stationary:  # no index +            return cleaned_data          index = cleaned_data.get("index", None)          warehouse = cleaned_data.get("location")          if not index: | 
