diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-10-05 11:57:12 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-10-25 12:06:03 +0200 |
commit | d0946d27cf49edb53def20feb59f11b899ae4a45 (patch) | |
tree | 8f389f7cc79f66b2b8967872b6aba17c85536604 /ishtar_common/wizards.py | |
parent | 0dc324c0c1294ef51f9cbd57d98fbf8e382bc9b5 (diff) | |
download | Ishtar-d0946d27cf49edb53def20feb59f11b899ae4a45.tar.bz2 Ishtar-d0946d27cf49edb53def20feb59f11b899ae4a45.zip |
Optimize context record wizard
Diffstat (limited to 'ishtar_common/wizards.py')
-rw-r--r-- | ishtar_common/wizards.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index 7b636538d..2b0a47a72 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): |