diff options
-rw-r--r-- | ishtar_common/wizards.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index c394fee09..d006db9ad 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -480,9 +480,15 @@ class Wizard(NamedUrlWizardView): frm = frm() required_fields = [k for k in frm.fields if frm.fields[k].required] - base_key = required_fields[-1] + base_key = None + if required_fields: + base_key = required_fields[-1] + elif frm.fields.keys(): + base_key = frm.fields.keys()[-1] init = self.get_form_initial(step, data=data) - total_field = len([key for key in data.keys() + total_field = 0 + if base_key: + total_field = len([key for key in data.keys() if base_key in key.split('-') and data[key]]) if init and not to_delete and ( |