diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-09-06 16:10:46 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-09-06 16:10:46 +0200 |
| commit | c18dba0656a194f966b95674e31993e88b650f78 (patch) | |
| tree | 656e7f51f769a313c16f32a0a62dd684c0d1639e /archaeological_context_records/wizards.py | |
| parent | 6a569a6ea6eb91791d0a6530d7604d2be2267af9 (diff) | |
| parent | 36d03c08136e6ff63812cbbc431d06304e7ba156 (diff) | |
| download | Ishtar-c18dba0656a194f966b95674e31993e88b650f78.tar.bz2 Ishtar-c18dba0656a194f966b95674e31993e88b650f78.zip | |
Merge branch 'v0.9' into wheezy
Diffstat (limited to 'archaeological_context_records/wizards.py')
| -rw-r--r-- | archaeological_context_records/wizards.py | 18 |
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 |
