summaryrefslogtreecommitdiff
path: root/ishtar_common/wizards.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2023-07-06 10:40:33 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2023-07-06 11:46:32 +0200
commite15763bbcee86bf867c43586d32a59acef30daa0 (patch)
tree96dcdbdf02933f8ebbf9d95dc73d7a9eb97bd41b /ishtar_common/wizards.py
parentd6509182b6f7a34ef2ead49232541f6350abeda6 (diff)
downloadIshtar-e15763bbcee86bf867c43586d32a59acef30daa0.tar.bz2
Ishtar-e15763bbcee86bf867c43586d32a59acef30daa0.zip
🐛 message after creation: use the generate_cached_label if no label is available
Diffstat (limited to 'ishtar_common/wizards.py')
-rw-r--r--ishtar_common/wizards.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py
index d7188faf5..2cf7a1b9c 100644
--- a/ishtar_common/wizards.py
+++ b/ishtar_common/wizards.py
@@ -1083,7 +1083,10 @@ class Wizard(IshtarWizard):
if getattr(self, "modification", False):
msg += str(_("{} modified.")).format(obj)
else:
- msg += str(_("{} created.")).format(obj)
+ lbl = str(obj)
+ if not lbl and hasattr(obj, "_generate_cached_label"):
+ lbl = obj._generate_cached_label()
+ msg += str(_("{} created.")).format(lbl)
messages.add_message(self.request, messages.INFO, msg)
if self.redirect_url:
url = reverse(self.redirect_url)