From eb93298d18f289544495e99e6d67cb803ef78f92 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 3 Oct 2018 21:35:15 +0200 Subject: Find search: add basket criteria --- ishtar_common/forms.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ishtar_common/forms.py') diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py index eec66e1a6..3dfcad09e 100644 --- a/ishtar_common/forms.py +++ b/ishtar_common/forms.py @@ -127,14 +127,15 @@ class CustomForm(object): need_user_for_initialization = True def __init__(self, *args, **kwargs): - current_user = None + self.current_user = None if 'user' in kwargs: try: - current_user = kwargs.pop('user').ishtaruser + self.current_user = kwargs.pop('user').ishtaruser except AttributeError: pass super(CustomForm, self).__init__(*args, **kwargs) - available, excluded, json_fields = self.check_custom_form(current_user) + available, excluded, json_fields = self.check_custom_form( + self.current_user) for exc in excluded: if hasattr(self, 'fields'): self.remove_field(exc) -- cgit v1.2.3