diff options
| -rw-r--r-- | ishtar_common/wizards.py | 25 | 
1 files changed, 14 insertions, 11 deletions
| diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index e64d259e7..e8052c768 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -715,19 +715,22 @@ class Wizard(NamedUrlWizardView):                          # check if there is no missing fields                          # should be managed normally in forms but... -                        if hasattr(model._meta, 'get_fields'):  # django 1.8 -                            fields = model._meta.get_field() -                        else: -                            fields = model._meta.fields +                        fields = model._meta.get_fields() + -                        has_problemetic_null = [ -                            (field.name, field.default == NOT_PROVIDED) -                            for field in fields +                        has_problemetic_null = False +                        for field in fields:                              if (field.name not in value -                                or not value[field.name]) -                            and not field.null and not field.blank -                            and (not field.default -                                 or field.default == NOT_PROVIDED)] +                                or not value[field.name]) \ +                                and (hasattr(field, 'null') +                                     and not field.null) \ +                                and (hasattr(field, 'blank') +                                     and not field.blank) \ +                                and (hasattr(field, 'default') +                                     and (not field.default +                                          or field.default == NOT_PROVIDED)): +                                    has_problemetic_null = True +                                    break                          if has_problemetic_null:                              continue | 
