summaryrefslogtreecommitdiff
path: root/archaeological_operations
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2012-10-21 22:49:56 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2012-10-21 22:49:56 +0200
commit39e0c9cf302f8b468e116047eef18f42d712166e (patch)
tree38ca8553def343f8aede7af10253286476c7eb24 /archaeological_operations
parent4e2c3dcd9dc31221a467a5bb4e727fd06336ea07 (diff)
downloadIshtar-39e0c9cf302f8b468e116047eef18f42d712166e.tar.bz2
Ishtar-39e0c9cf302f8b468e116047eef18f42d712166e.zip
Djangoization - Major refactoring (step 14)
* Fix formset UI. * Fix formset towns. * Clean-up
Diffstat (limited to 'archaeological_operations')
-rw-r--r--archaeological_operations/views.py36
-rw-r--r--archaeological_operations/wizards.py4
2 files changed, 20 insertions, 20 deletions
diff --git a/archaeological_operations/views.py b/archaeological_operations/views.py
index 38e2a1bc4..a9200cafa 100644
--- a/archaeological_operations/views.py
+++ b/archaeological_operations/views.py
@@ -32,11 +32,12 @@ import models
def autocomplete_operation(request, non_closed=True):
person_types = request.user.ishtaruser.person.person_type
- if (not request.user.has_perm('ishtar_common.view_operation', models.Operation)\
- and not request.user.has_perm('ishtar_common.view_own_operation',
- models.Operation)
- and not person_types.rights.filter(wizard__url_name='operation_search'
- ).count()):
+ if (not request.user.has_perm('ishtar_common.view_operation',
+ models.Operation)
+ and not request.user.has_perm('ishtar_common.view_own_operation',
+ models.Operation)
+ and not person_types.rights.filter(
+ wizard__url_name='operation_search').count()):
return HttpResponse(mimetype='text/plain')
if not request.GET.get('term'):
return HttpResponse(mimetype='text/plain')
@@ -59,32 +60,33 @@ def autocomplete_operation(request, non_closed=True):
return HttpResponse(data, mimetype='text/plain')
def get_available_operation_code(request, year=None):
- if not request.user.has_perm('ishtar_common.view_operation', models.Operation)\
+ if not request.user.has_perm('ishtar_common.view_operation',
+ models.Operation)\
and not request.user.has_perm('ishtar_common.view_own_operation',
- models.Operation):
+ models.Operation):
return HttpResponse(mimetype='text/plain')
data = json.dumps({'id':models.Operation.get_available_operation_code(year)})
return HttpResponse(data, mimetype='text/plain')
get_operation = get_item(models.Operation, 'get_operation', 'operation',
- bool_fields = ['end_date__isnull'],
- extra_request_keys={'common_name':'common_name__icontains',
- 'end_date':'end_date__isnull',
- 'year_index':('year', 'operation_code')})
+ bool_fields = ['end_date__isnull'],
+ extra_request_keys={'common_name':'common_name__icontains',
+ 'end_date':'end_date__isnull',
+ 'year_index':('year', 'operation_code')})
show_operation = show_item(models.Operation, 'operation')
revert_operation = revert_item(models.Operation)
get_operationsource = get_item(models.OperationSource,
- 'get_operationsource', 'operationsource',
- extra_request_keys={'operation__towns':'operation__towns__pk',
+ 'get_operationsource', 'operationsource',
+ extra_request_keys={'operation__towns':'operation__towns__pk',
'operation__operation_type':'operation__operation_type__pk',
'operation__year':'operation__year'})
get_administrativeactop = get_item(models.AdministrativeAct,
- 'get_administrativeactop', 'administrativeactop',
- extra_request_keys={'associated_file__towns':'associated_file__towns__pk',
- 'operation__towns':'operation__towns__pk',
- 'act_type__intented_to':'act_type__intented_to'})
+ 'get_administrativeactop', 'administrativeactop',
+ extra_request_keys={'associated_file__towns':'associated_file__towns__pk',
+ 'operation__towns':'operation__towns__pk',
+ 'act_type__intented_to':'act_type__intented_to'})
def dashboard_operation(request, dct, obj_id=None, *args, **kwargs):
diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py
index 66469b5b7..3281a5723 100644
--- a/archaeological_operations/wizards.py
+++ b/archaeological_operations/wizards.py
@@ -36,9 +36,7 @@ class OperationWizard(Wizard):
templates = super(OperationWizard, self).get_template_names()
current_step = self.steps. current
if current_step.startswith('towns-'):
- # vérifier que le context_data est bien chargé
- #templates = ['ishtar/wizard/towns_wizard.html'] + templates
- templates = ['ishtar/wizar/towns_wizard.html'] + templates
+ templates = ['ishtar/wizard/towns_wizard.html'] + templates
return templates
def get_context_data(self, form, **kwargs):