summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/wizards.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_warehouse/wizards.py')
-rw-r--r--archaeological_warehouse/wizards.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/archaeological_warehouse/wizards.py b/archaeological_warehouse/wizards.py
index 3d762ceb6..7476eb2b7 100644
--- a/archaeological_warehouse/wizards.py
+++ b/archaeological_warehouse/wizards.py
@@ -76,6 +76,19 @@ class WarehouseWizard(Wizard):
model = models.Warehouse
wizard_done_window = reverse_lazy('show-warehouse')
+ def save_model(self, dct, m2m, whole_associated_models, form_list,
+ return_object):
+ create_organization = False
+ if 'create_organization' in dct:
+ create_organization = dct.pop('create_organization')
+ obj, res = super(WarehouseWizard, self).save_model(
+ dct, m2m, whole_associated_models, form_list, True
+ )
+ if self.modification or not create_organization:
+ return return_object and (obj, res) or res
+ obj.create_attached_organization()
+ return return_object and (obj, res) or res
+
class WarehouseModificationWizard(Wizard):
model = models.Warehouse