From fa90d96f807d56d87ccfbb3141e70a7603ca5b60 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 2 Jun 2020 13:18:25 +0200 Subject: Documents form: new fields --- ishtar_common/widgets.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ishtar_common/widgets.py') diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index 9483f9719..e5f4c67b1 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -606,10 +606,7 @@ class JQueryAutoComplete(forms.TextInput): """ self.source = source self.associated_model = associated_model - if callable(tips): - self.tips = tips() - else: - self.tips = tips + self.tips = tips self.options = None if options and len(options) > 0: @@ -733,11 +730,14 @@ class JQueryAutoComplete(forms.TextInput): # "extra_form_modals" list is used for that in form or view model_name = self.associated_model._meta.object_name.lower() if self.tips: + tips = self.tips + if callable(tips): + tips = tips() new += """ {} - """.format(attrs_hidden['id'], self.tips) + """.format(attrs_hidden['id'], tips) if self.modify: new += """ -- cgit v1.2.3