diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-04-07 12:22:27 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-04-07 12:22:27 +0200 |
| commit | 93364489ab4e6daf16f924b2d8212f7fcdc5e477 (patch) | |
| tree | e0686c289c399330f414b50ff8ef58f642833db2 /ishtar_common/wizards.py | |
| parent | c788bef47de6bca5dda5dd1fa67dd6a2ac02e9b9 (diff) | |
| parent | a8271676a0598594762cc53e4f577337eb275313 (diff) | |
| download | Ishtar-93364489ab4e6daf16f924b2d8212f7fcdc5e477.tar.bz2 Ishtar-93364489ab4e6daf16f924b2d8212f7fcdc5e477.zip | |
Merge branch 'v0.9' into wheezy
Diffstat (limited to 'ishtar_common/wizards.py')
| -rw-r--r-- | ishtar_common/wizards.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index 7950bcc7e..8d787d733 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -51,10 +51,16 @@ class MultiValueDict(BaseMultiValueDict): v = v() if type(v) in (list, tuple) and len(v) > 1: v = ",".join(v) - else: + elif type(v) not in (int, unicode): v = super(MultiValueDict, self).get(*args, **kwargs) return v + def getlist(self, *args, **kwargs): + lst = super(MultiValueDict, self).getlist(*args, **kwargs) + if type(lst) not in (tuple, list): + lst = [lst] + return lst + def check_rights(rights=[], redirect_url='/'): """ @@ -408,6 +414,8 @@ class Wizard(NamedUrlWizardView): for form in form_list: if not form.is_valid(): return self.render(form) + if hasattr(form, 'readonly') and form.readonly: + continue base_form = hasattr(form, 'forms') and form.forms[0] or form associated_models = hasattr(base_form, 'associated_models') and \ base_form.associated_models or {} @@ -817,7 +825,7 @@ class Wizard(NamedUrlWizardView): # get a form key frm = form.form if callable(frm): - frm = frm() + frm = frm(self.get_form_kwargs(step)) total_field = 0 if hasattr(frm, 'count_valid_fields'): |
