From e177200278d2a9a8ea1e2ae0b811705c59b8e68b Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 6 Jan 2014 12:05:38 +0100 Subject: Fix bad administrativ act for files (refs #1589) --- archaeological_operations/views.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'archaeological_operations') diff --git a/archaeological_operations/views.py b/archaeological_operations/views.py index 0c4609181..233c45d19 100644 --- a/archaeological_operations/views.py +++ b/archaeological_operations/views.py @@ -330,10 +330,13 @@ def generatedoc_administrativeactop(request, pk, template_pk=None): return HttpResponse(mimetype='text/plain') def administrativeactfile_document(request, operation=True): + search_form = AdministrativeActOpeFormSelection + if not operation: + from archaeological_files.forms import AdministrativeActFileFormSelection + search_form = AdministrativeActFileFormSelection dct = {} if request.POST: - dct['search_form'] = AdministrativeActOperationFormSelection( - request.POST) + dct['search_form'] = search_form(request.POST) dct['template_form'] = DocumentGenerationAdminActForm(request.POST, operation=operation) if dct['search_form'].is_valid() and dct['template_form'].is_valid(): @@ -341,7 +344,7 @@ def administrativeactfile_document(request, operation=True): dct['search_form'].cleaned_data.get('pk'), dct['template_form'].cleaned_data.get('document_template')) else: - dct['search_form'] = AdministrativeActOpeFormSelection() + dct['search_form'] = search_form() dct['template_form'] = DocumentGenerationAdminActForm( operation=operation) return render_to_response('ishtar/administrativeact_document.html', dct, -- cgit v1.2.3