From 6e0edd25093296d3f3c2c7ff5291e8e5174fa595 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 3 Oct 2022 13:46:12 +0200 Subject: Fix delete wizard with no "class_verbose_name" --- CHANGES.md | 9 ++++++++- archaeological_finds/models_treatments.py | 4 ++++ ishtar_common/version.py | 4 ++-- ishtar_common/wizards.py | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d32f8db3a..80fa2f555 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,11 +1,18 @@ --- title: Ishtar changelog -date: 2022-09-18 +date: 2022-10-03 --- Ishtar changelog ================ +v3.2.7 - 2022-10-03 +------------------- + +### Bug fix ### +- Fix delete wizard with no "class_verbose_name" + + v3.2.6 - 2022-09-28 ------------------- diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index 28e6618d6..5d4597b19 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -1181,6 +1181,10 @@ class TreatmentFile( def short_class_name(self): return _("Treatment request") + @classmethod + def class_verbose_name(cls): # TODO: should be unecessary if MainItem + return cls._meta.verbose_name + @classmethod def get_query_owns(cls, ishtaruser): return ( diff --git a/ishtar_common/version.py b/ishtar_common/version.py index f4b870e72..6de4cb1d6 100644 --- a/ishtar_common/version.py +++ b/ishtar_common/version.py @@ -1,5 +1,5 @@ -# 3.2.6 -VERSION = (3, 2, 6) +# 3.2.7 +VERSION = (3, 2, 7) def get_version(): diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index e5b8b55ba..2d000e423 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -1796,7 +1796,7 @@ class MultipleDeletionWizard(MultipleItemWizard): if field in res: data.append(res[field]) obj = self.current_objs[idx] - datas.append((f"{obj.class_verbose_name()} - {obj}", data)) + datas.append((f"{obj.class_verbose_name() if hasattr(obj, 'class_verbose_name') else ''} - {obj}", data)) return datas def get_context_data(self, form, **kwargs): -- cgit v1.2.3