summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2021-10-05 11:57:12 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2022-07-08 09:58:48 +0200
commit90f70cab6935ea31d45151ffde0862cf59d01c14 (patch)
tree413cf2e6d461ecde4ecbfd25d0b2e716f8e9fb3e /ishtar_common
parentbac3bd38813fb2b9c303bb4214f4c5829a05e794 (diff)
downloadIshtar-90f70cab6935ea31d45151ffde0862cf59d01c14.tar.bz2
Ishtar-90f70cab6935ea31d45151ffde0862cf59d01c14.zip
Optimize context record wizard
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/wizards.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py
index 4a8fb9a8d..38afa0bfb 100644
--- a/ishtar_common/wizards.py
+++ b/ishtar_common/wizards.py
@@ -1330,6 +1330,8 @@ class Wizard(IshtarWizard):
def get_current_object(self):
"""Get the current object for an instanced wizard"""
+ if hasattr(self, "_current_object"):
+ return self._current_object
current_obj = None
for key in self.main_item_select_keys:
main_form_key = key + self.url_name
@@ -1341,6 +1343,8 @@ class Wizard(IshtarWizard):
break
except (TypeError, ValueError, ObjectDoesNotExist):
pass
+ if current_obj:
+ self._current_object = current_obj
return current_obj
def get_form_initial(self, step, data=None):