diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-11-12 16:18:57 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-11-12 16:18:57 +0100 |
commit | 6acabb8565d91e68d3e5e970f288cd29c5614017 (patch) | |
tree | d7f34f347aa533855990da473b17fc35f5bb1878 /ishtar_common/widgets.py | |
parent | 84ddcc01671afbc96ff81b0847419823ca35783d (diff) | |
download | Ishtar-6acabb8565d91e68d3e5e970f288cd29c5614017.tar.bz2 Ishtar-6acabb8565d91e68d3e5e970f288cd29c5614017.zip |
Fix pin and unpi for administrativ acts
Diffstat (limited to 'ishtar_common/widgets.py')
-rw-r--r-- | ishtar_common/widgets.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index 6292db202..7d9e06926 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -483,15 +483,19 @@ class CheckboxInput(forms.CheckboxInput): class SearchWidget(forms.TextInput): template_name = 'widgets/search_input.html' - def __init__(self, app_name=None, model=None, attrs=None): + def __init__(self, app_name=None, model=None, pin_model=None, attrs=None): super(SearchWidget, self).__init__(attrs) self.app_name = app_name self.model = model + if not pin_model: + pin_model = self.model + self.pin_model = pin_model def get_context(self, name, value, attrs): context = super(SearchWidget, self).get_context(name, value, attrs) context['app_name'] = self.app_name context['model'] = self.model + context['pin_model'] = self.pin_model return context |