diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-09-06 18:18:07 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-10-24 12:06:08 +0200 |
commit | 1a05ab6a12d24f5c9c27172d924fbdbc9e5ddfbe (patch) | |
tree | 7752e884cbbd4d1b696ad252961fa2e815c216c3 /ishtar_common/forms.py | |
parent | 17decf4c9e96b5ee53b79fbbdb02d25d6ba98ede (diff) | |
download | Ishtar-1a05ab6a12d24f5c9c27172d924fbdbc9e5ddfbe.tar.bz2 Ishtar-1a05ab6a12d24f5c9c27172d924fbdbc9e5ddfbe.zip |
Quick action: manage ajax form
Diffstat (limited to 'ishtar_common/forms.py')
-rw-r--r-- | ishtar_common/forms.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py index 106b68c14..2e249e472 100644 --- a/ishtar_common/forms.py +++ b/ishtar_common/forms.py @@ -455,6 +455,8 @@ class IshtarForm(forms.Form): if not getattr(profile, profile_key): for field_key in self.PROFILE_FILTER[profile_key]: self.fields.pop(field_key) + if getattr(self, 'confirm', True): + return for field in self.TYPES: self._init_type(field) for k in self.fields: @@ -646,11 +648,14 @@ class QAForm(CustomForm, ManageOldType): def __init__(self, *args, **kwargs): self.items = kwargs.pop('items') + self.confirm = kwargs.pop('confirm') super(QAForm, self).__init__(*args, **kwargs) for k in self.fields.keys(): if self.MULTI and k in self.SINGLE_FIELDS: self.fields.pop(k) continue + if self.confirm: + self.fields[k].widget = forms.HiddenInput() if self.MULTI and k not in self.REPLACE_FIELDS: self.fields[k].label = unicode(self.fields[k].label) + \ unicode(u" - append to existing") |