From a584b08f7c347af2fb85df86ddd89430c14824c0 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 13 Feb 2015 13:20:45 +0100 Subject: Wizard: search on multiple form for current town - Add research files form on archaeological_files_pdl --- archaeological_operations/wizards.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'archaeological_operations/wizards.py') diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py index 7fdc26b12..01f15886d 100644 --- a/archaeological_operations/wizards.py +++ b/archaeological_operations/wizards.py @@ -39,7 +39,7 @@ class OperationWizard(Wizard): model = models.Operation object_parcel_type = 'operation' parcel_step_key = 'parcelsgeneral-' - town_step_key = 'towns-' # step contening the current(s) town(s) + town_step_keys = ['towns-'] # step contening the current(s) town(s) town_input_id = 'town' # input id of the current(s) town(s) multi_towns = True # true if current town are multi wizard_done_window = reverse_lazy('show-operation') @@ -139,10 +139,14 @@ class OperationWizard(Wizard): if file: data['PARCELS'] = self.get_available_parcels(file) else: - town_form_key = self.town_step_key + self.url_name - town_ids = self.session_get_value(town_form_key, + town_ids = [] + for town_step_key in self.town_step_keys: + town_form_key = town_step_key + self.url_name + town_ids = self.session_get_value(town_form_key, self.town_input_id, multi=self.multi_towns) or [] + if town_ids: + break if not self.multi_towns and town_ids: town_ids = [town_ids] towns = [] -- cgit v1.2.3