summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2014-04-04 10:18:02 +0200
committerÉtienne Loks <etienne.loks@proxience.com>2014-04-04 10:18:02 +0200
commit1879535e1f1ecca799fff5e2439b6d826d60773e (patch)
tree858b51b65551fd32395bd4c170c42b6df372c13d
parentf03c9a7f969d66d4b7ccb945e14f567022f59528 (diff)
downloadIshtar-1879535e1f1ecca799fff5e2439b6d826d60773e.tar.bz2
Ishtar-1879535e1f1ecca799fff5e2439b6d826d60773e.zip
Fix town/parcel selection on operation creation (refs #1745)
-rw-r--r--archaeological_operations/views.py8
-rw-r--r--archaeological_operations/wizards.py4
2 files changed, 6 insertions, 6 deletions
diff --git a/archaeological_operations/views.py b/archaeological_operations/views.py
index 0ed9cb9c7..5d5038758 100644
--- a/archaeological_operations/views.py
+++ b/archaeological_operations/views.py
@@ -192,13 +192,13 @@ operation_creation_wizard = OperationWizard.as_view([
is_preventive('general-operation_creation', models.OperationType,
'operation_type', 'arch_diagnostic'),
'townsgeneral-operation_creation':has_associated_file(
- 'general-operation_creation', negate=True),
+ 'filechoice-operation_creation', negate=True),
'towns-operation_creation':has_associated_file(
- 'general-operation_creation'),
+ 'filechoice-operation_creation'),
'parcelsgeneral-operation_creation':has_associated_file(
- 'general-operation_creation', negate=True),
+ 'filechoice-operation_creation', negate=True),
'parcels-operation_creation':has_associated_file(
- 'general-operation_creation'),
+ 'filechoice-operation_creation'),
},
url_name='operation_creation',)
diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py
index 821d5eedc..eb6788ac4 100644
--- a/archaeological_operations/wizards.py
+++ b/archaeological_operations/wizards.py
@@ -74,7 +74,7 @@ class OperationWizard(Wizard):
context = super(OperationWizard, self).get_context_data(form,
**kwargs)
step = self.steps.current
- if step.startswith('towns-'):
+ if step.startswith('towns'):
context['TOWNS'] = self.get_towns()
elif step.startswith('parcels-') and self.get_current_file():
# if a file is acciated to the operation add the button "Add all"
@@ -135,7 +135,7 @@ class OperationWizard(Wizard):
if self.url_name == 'operation_creation':
file_form_key = 'filechoice-' + self.url_name
# manage the dynamic choice of towns
- if step.startswith('towns-') and hasattr(form, 'management_form'):
+ if step.startswith('towns') and hasattr(form, 'management_form'):
data['TOWNS'] = self.get_towns()
elif step.startswith('parcels') and hasattr(form, 'management_form'):
file_id = self.session_get_value(file_form_key, "associated_file")