diff options
| author | Étienne Loks <etienne.loks@proxience.com> | 2015-11-27 17:25:29 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@proxience.com> | 2015-11-27 17:25:29 +0100 | 
| commit | 3435ed1026893b2c144d0e5dd84ca09eb071ea31 (patch) | |
| tree | 564ac3fd99fc920c90719222183f7137f0730109 /ishtar_common/wizards.py | |
| parent | fb5e880634a792cf9e30ea3f0f5c0d0a680f4a32 (diff) | |
| download | Ishtar-3435ed1026893b2c144d0e5dd84ca09eb071ea31.tar.bz2 Ishtar-3435ed1026893b2c144d0e5dd84ca09eb071ea31.zip | |
Wizard: fix callable attributes
Diffstat (limited to 'ishtar_common/wizards.py')
| -rw-r--r-- | ishtar_common/wizards.py | 4 | 
1 files changed, 4 insertions, 0 deletions
| diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index 5f3d440e4..8fe1b5da2 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -423,6 +423,8 @@ class Wizard(NamedUrlWizardView):                      c_item.save()                  else:                      m = getattr(self.model, dependant_item) +                    if callable(m): +                        m = m()                      if hasattr(m, 'related'):                          c_item = m.related.model(**other_objs[dependant_item])                          setattr(obj, dependant_item, c_item) @@ -432,6 +434,8 @@ class Wizard(NamedUrlWizardView):              adds = {}              for dependant_item in other_objs:                  m = getattr(self.model, dependant_item) +                if callable(m): +                    m = m()                  model = m.field.rel.to                  c_dct = other_objs[dependant_item].copy()                  if issubclass(model, models.BaseHistorizedItem): | 
