summaryrefslogtreecommitdiff
path: root/ishtar_common/wizards.py
diff options
context:
space:
mode:
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
commita52c06fe5a74d1b8c1f5c940932ce96e5fdc622d (patch)
tree564ac3fd99fc920c90719222183f7137f0730109 /ishtar_common/wizards.py
parent9348e754e62ac086301c57bc9f4a5442adae6e94 (diff)
downloadIshtar-a52c06fe5a74d1b8c1f5c940932ce96e5fdc622d.tar.bz2
Ishtar-a52c06fe5a74d1b8c1f5c940932ce96e5fdc622d.zip
Wizard: fix callable attributes
Diffstat (limited to 'ishtar_common/wizards.py')
-rw-r--r--ishtar_common/wizards.py4
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):