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 | a52c06fe5a74d1b8c1f5c940932ce96e5fdc622d (patch) | |
tree | 564ac3fd99fc920c90719222183f7137f0730109 | |
parent | 9348e754e62ac086301c57bc9f4a5442adae6e94 (diff) | |
download | Ishtar-a52c06fe5a74d1b8c1f5c940932ce96e5fdc622d.tar.bz2 Ishtar-a52c06fe5a74d1b8c1f5c940932ce96e5fdc622d.zip |
Wizard: fix callable attributes
-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): |