summaryrefslogtreecommitdiff
path: root/archaeological_context_records/wizards.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-09-06 15:52:40 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-09-06 15:52:40 +0200
commite2027c3b2c4bcc2356ec06b5fb6dc8d5bf780e50 (patch)
treeced06e4a3e0ef4600d2dbbf2741f001125c162bf /archaeological_context_records/wizards.py
parent180d93d47cfae279ef927ea5fa736fa1fc37c553 (diff)
parentb7a7183cdb07c7782abac7fe01d86cc2beb1411e (diff)
downloadIshtar-e2027c3b2c4bcc2356ec06b5fb6dc8d5bf780e50.tar.bz2
Ishtar-e2027c3b2c4bcc2356ec06b5fb6dc8d5bf780e50.zip
Merge branch 'master' into v0.9
Diffstat (limited to 'archaeological_context_records/wizards.py')
-rw-r--r--archaeological_context_records/wizards.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/archaeological_context_records/wizards.py b/archaeological_context_records/wizards.py
index 2449b400e..2780acfbc 100644
--- a/archaeological_context_records/wizards.py
+++ b/archaeological_context_records/wizards.py
@@ -52,6 +52,15 @@ class RecordWizard(Wizard):
return current_ope
except(TypeError, ValueError, ObjectDoesNotExist):
pass
+ else:
+ ope_form_key = 'operation-' + self.url_name
+ try:
+ idx = int(self.session_get_value(
+ ope_form_key, 'operation'))
+ current_ope = models.Operation.objects.get(pk=idx)
+ return current_ope
+ except(TypeError, ValueError, ObjectDoesNotExist):
+ pass
current_cr = self.get_current_object()
if current_cr:
return current_cr.operation
@@ -92,6 +101,15 @@ class RecordWizard(Wizard):
data['operation'] = current_obj
except(TypeError, ValueError, ObjectDoesNotExist):
pass
+ elif step.endswith('_modification'):
+ ope_form_key = 'operation-' + self.url_name
+ try:
+ idx = int(self.session_get_value(ope_form_key,
+ 'operation'))
+ current_obj = models.Operation.objects.get(pk=idx)
+ data['operation'] = current_obj
+ except(TypeError, ValueError, ObjectDoesNotExist):
+ pass
else:
current_object = self.get_current_object()
data['context_record'] = current_object