diff options
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'): |