diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-10-21 01:31:49 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-10-21 01:31:49 +0200 |
commit | 48eb91979705f9999b724c8e2f960fd7931775c1 (patch) | |
tree | b0ce9167008a2ef608f522680f3d11a0459663e4 /archaeological_operations/wizards.py | |
parent | 5b8c7201eefa8b404afb0cb89b389fd3e8f92899 (diff) | |
download | Ishtar-48eb91979705f9999b724c8e2f960fd7931775c1.tar.bz2 Ishtar-48eb91979705f9999b724c8e2f960fd7931775c1.zip |
Djangoization - Major refactoring (step 7)
Work on archaeological_files wizards
Diffstat (limited to 'archaeological_operations/wizards.py')
-rw-r--r-- | archaeological_operations/wizards.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py index df785fe6e..542d0118b 100644 --- a/archaeological_operations/wizards.py +++ b/archaeological_operations/wizards.py @@ -45,7 +45,8 @@ class OperationWizard(Wizard): """ context = super(OperationWizard, self).get_extra_context(request, storage) - step = self.determine_step(request, storage) + #step = self.determine_step(request, storage) + step = self.steps.current if not step.startswith('towns-'): return context context['TOWNS'] = self.get_towns(request, storage) @@ -79,7 +80,8 @@ class OperationWizard(Wizard): else: data = {} if not step: - step = self.determine_step(request, storage) + #step = self.determine_step(request, storage) + step = self.steps.current form = self.get_form_list(request, storage)[step] general_form_key = 'general-' + self.url_name # manage the dynamic choice of towns @@ -229,7 +231,9 @@ class AdministrativeActDeletionWizard(ClosingWizard): context_instance=RequestContext(request)) def is_preventive(form_name, model, type_key='operation_type', key=''): - def func(self, request, storage): + def func(self): + request = self.request + storage = self.storage if storage.prefix not in request.session or \ 'step_data' not in request.session[storage.prefix] or \ form_name not in request.session[storage.prefix]['step_data'] or\ @@ -238,7 +242,7 @@ def is_preventive(form_name, model, type_key='operation_type', key=''): return False try: typ = int(request.session[storage.prefix]['step_data']\ - [form_name][form_name+'-'+type_key]) + [form_name][form_name+'-'+type_key][0]) return model.is_preventive(typ, key) except ValueError: return False |