From af36826678104f6a5cc1bffe66510ab32ad10160 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 11 May 2023 11:03:09 +0200 Subject: 🐛 Container import: do not crash on empty container type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archaeological_warehouse/models.py | 2 +- changelog/en/changelog_2022-06-15.md | 1 + changelog/fr/changelog_2023-01-25.md | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index a59371776..048f02d4d 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -1900,7 +1900,7 @@ class Container( self.responsibility = self.location except Warehouse.DoesNotExist: return - if self.container_type.stationary: + if not hasattr(self, "container_type") or self.container_type.stationary: return q = Container.objects.filter(index=self.index, location=self.location) if self.id: diff --git a/changelog/en/changelog_2022-06-15.md b/changelog/en/changelog_2022-06-15.md index 3c29d3a36..687b9b942 100644 --- a/changelog/en/changelog_2022-06-15.md +++ b/changelog/en/changelog_2022-06-15.md @@ -11,6 +11,7 @@ v4.0.45 - 2023- ### Technical ### - Migration font-awesome -> fork-awesome - Inline JS migrated to a dynamic, cacheable settings.js +- Container import: do not crash on empty container type v4.0.44 - 2023-04-17 -------------------- diff --git a/changelog/fr/changelog_2023-01-25.md b/changelog/fr/changelog_2023-01-25.md index 86a2caa87..3a87bab31 100644 --- a/changelog/fr/changelog_2023-01-25.md +++ b/changelog/fr/changelog_2023-01-25.md @@ -11,6 +11,7 @@ v4.0.45 - 2023- ### Technique ### - Migration de la bibliothèque font-awesome -> fork-awesome - JS inline migré vers un settings.js dynamique pouvant être mis en cache +- Import contenants : éviter le crash si le type de contenant est vide v4.0.44 - 2023-04-17 -- cgit v1.2.3