diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-06-02 13:18:25 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:21 +0100 |
commit | fa90d96f807d56d87ccfbb3141e70a7603ca5b60 (patch) | |
tree | 22f26730c66de9d357f3ceb2f343d6d0cab53b91 /ishtar_common/widgets.py | |
parent | 916311c130b2a736374444894e232df605fd7d19 (diff) | |
download | Ishtar-fa90d96f807d56d87ccfbb3141e70a7603ca5b60.tar.bz2 Ishtar-fa90d96f807d56d87ccfbb3141e70a7603ca5b60.zip |
Documents form: new fields
Diffstat (limited to 'ishtar_common/widgets.py')
-rw-r--r-- | ishtar_common/widgets.py | 10 |
1 files changed, 5 insertions, 5 deletions
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 += """<span class="input-group-append"> <span class="add-button input-group-text"> <em id="{}-tips">{}</em> </span></span> - """.format(attrs_hidden['id'], self.tips) + """.format(attrs_hidden['id'], tips) if self.modify: new += """ <span class="input-group-append"> |