summaryrefslogtreecommitdiff
path: root/archaeological_operations/wizards.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_operations/wizards.py')
-rw-r--r--archaeological_operations/wizards.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py
index 8e88a389c..5545dd666 100644
--- a/archaeological_operations/wizards.py
+++ b/archaeological_operations/wizards.py
@@ -352,21 +352,20 @@ class OperationAdministrativeActWizard(OperationWizard):
# check if a doc generation is required
keys = [self.storage.prefix, 'step_data', 'final-' + self.url_name,
'doc_generation']
- level = 0
r = self.request.session
for k in keys:
if k in r and r[k]:
- level += 1
r = r[k]
else:
break
- if level == len(keys): # the whole list as been traversed
+ if k == keys[-1]: # the whole list as been traversed
wizard_done_window = unicode(self.wizard_done_window)
if wizard_done_window:
dct['wizard_done_window'] = wizard_done_window
# redirect to the generated doc
- dct['redirect'] = reverse('generatedoc-administrativeactop',
- args=[admact.pk, r[0]])
+ if r[0]:
+ dct['redirect'] = reverse('generatedoc-administrativeactop',
+ args=[admact.pk, r[0]])
res = render_to_response('ishtar/wizard/wizard_done.html', dct,
context_instance=RequestContext(self.request))