diff options
Diffstat (limited to 'archaeological_warehouse/models.py')
| -rw-r--r-- | archaeological_warehouse/models.py | 9 | 
1 files changed, 5 insertions, 4 deletions
| diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index 00500bdcf..f88631d80 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -285,11 +285,13 @@ class Warehouse(      MODEL = "warehouse"      SHOW_URL = "show-warehouse"      DELETE_URL = "delete-warehouse" +    DOWN_MODEL_UPDATE = ["containers", "responsibilities"]      TABLE_COLS = ["name", "warehouse_type__label", "cached_town_label"]      COL_LABELS = {          "warehouse_type__label": _("Type"),          "cached_town_label": _("Town"),      } +    INITIAL_VALUES = ["name", "slug"]      NEW_QUERY_ENGINE = True      BASE_SEARCH_VECTORS = [          SearchVectorConfig("name"), @@ -320,7 +322,6 @@ class Warehouse(          ),      }      GEO_LABEL = "name" -    DOWN_MODEL_UPDATE = ["containers"]      FORCE_CASCADE_UPDATE = True      CACHED_LABELS = ["cached_town_label"] @@ -671,9 +672,8 @@ class Warehouse(                  self.external_id = external_id                  updated = True          if updated: -            self.skip_history_when_saving = True +            self.no_post_process()              self._cached_label_checked = False -            self.force_update = True              self.save() @@ -1458,6 +1458,7 @@ class Container(          ):              if child.location != parent.location:                  child.location = parent.location +                child.skip_history_when_saving = True                  child.save()              cls._change_child_location(child) @@ -1926,7 +1927,7 @@ class Container(      def save(self, *args, **kwargs):          self.pre_save() -        super(Container, self).save(*args, **kwargs) +        super().save(*args, **kwargs)          self._change_child_location(self)          updated = False          updated += self._prevent_parent_infinite_loop() | 
