diff options
Diffstat (limited to 'ishtar_common')
| -rw-r--r-- | ishtar_common/wizards.py | 10 | 
1 files changed, 6 insertions, 4 deletions
| diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index 40044f100..a6d0befd5 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -600,7 +600,7 @@ class Wizard(NamedUrlWizardView):          dct = self.get_extra_model(dct, form_list)          obj = self.get_current_saved_object()          data = {} -        if obj: +        if obj and hasattr(obj, 'data'):              data = obj.data          # manage dependant items and json fields @@ -647,7 +647,8 @@ class Wizard(NamedUrlWizardView):                      elif type(dct[k]) not in (list, tuple):                          dct[k] = [dct[k]]                  setattr(obj, k, dct[k]) -            obj.data = data +            if hasattr(obj, 'data'): +                obj.data = data              if hasattr(obj, 'pre_save'):                  obj.pre_save()              try: @@ -732,7 +733,8 @@ class Wizard(NamedUrlWizardView):              except ValidationError as e:                  logger.warning(unicode(e))                  return self.render(form_list[-1]) -            obj.data = data +            if hasattr(obj, 'data'): +                obj.data = data              obj.save(**saved_args)              for k in adds:                  getattr(obj, k).add(adds[k]) @@ -1267,7 +1269,7 @@ class Wizard(NamedUrlWizardView):          initial = MultiValueDict()          # manage json field -        if hasattr(self, 'json_fields') \ +        if hasattr(obj, 'data') and obj.data and hasattr(self, 'json_fields') \                  and getattr(c_form, 'form_slug', None) \                  and c_form.form_slug in self.json_fields \                  and obj.data: | 
