From e6fad805c7b14ccdc06aca1c865b9d63151d9d62 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Mon, 13 Jun 2011 09:51:21 -0400 Subject: [PATCH] Fixed zip file handling --- apps/documents/views.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/documents/views.py b/apps/documents/views.py index eae1dc51f1..924ea7f468 100644 --- a/apps/documents/views.py +++ b/apps/documents/views.py @@ -126,9 +126,11 @@ def document_create_siblings(request, document_id): def _handle_save_document(request, document, form=None): RecentDocument.objects.add_document_for_user(request.user, document) - if form.cleaned_data['new_filename']: - document.file_filename = form.cleaned_data['new_filename'] - document.save() + + if form: + if form.cleaned_data['new_filename']: + document.file_filename = form.cleaned_data['new_filename'] + document.save() if form and 'document_type_available_filenames' in form.cleaned_data: if form.cleaned_data['document_type_available_filenames']: