From 9f1ef7cfa988c0aee1b6334dd65153bb04b3421e Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Fri, 8 Jul 2011 03:13:27 -0400 Subject: [PATCH] Updated the upload_interactive view to conserve an invalid form to display its error on the template --- apps/sources/views.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/sources/views.py b/apps/sources/views.py index 3c8940cd24..f5d906c0f5 100644 --- a/apps/sources/views.py +++ b/apps/sources/views.py @@ -135,8 +135,8 @@ def upload_interactive(request, source_type=None, source_id=None): messages.error(request, e) return HttpResponseRedirect(request.get_full_path()) - - form = WebFormForm(show_expand=(web_form.uncompress==SOURCE_UNCOMPRESS_CHOICE_ASK), document_type=document_type) + else: + form = WebFormForm(show_expand=(web_form.uncompress==SOURCE_UNCOMPRESS_CHOICE_ASK), document_type=document_type) subtemplates_list.append({ 'name': 'generic_form_subtemplate.html', @@ -179,11 +179,11 @@ def upload_interactive(request, source_type=None, source_id=None): messages.error(request, e) return HttpResponseRedirect(request.get_full_path()) - - form = StagingDocumentForm(cls=StagingFile, - document_type=document_type, - show_expand=(staging_folder.uncompress==SOURCE_UNCOMPRESS_CHOICE_ASK) - ) + else: + form = StagingDocumentForm(cls=StagingFile, + document_type=document_type, + show_expand=(staging_folder.uncompress==SOURCE_UNCOMPRESS_CHOICE_ASK) + ) try: staging_filelist = StagingFile.get_all() except Exception, e: