From 90cefa614654763b142b277d7b9ce08ccca07da2 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 5 Oct 2021 11:57:12 +0200 Subject: Optimize context record wizard --- ishtar_common/wizards.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ishtar_common/wizards.py') 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): -- cgit v1.2.3