From cbd2644c59496d6786ce529f2d3e5874929a5d2f Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Mon, 27 Oct 2014 23:20:55 -0400 Subject: [PATCH] Make sure label exists --- mayan/apps/sources/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mayan/apps/sources/views.py b/mayan/apps/sources/views.py index cd73ce639b..918dc0eb4c 100644 --- a/mayan/apps/sources/views.py +++ b/mayan/apps/sources/views.py @@ -211,6 +211,7 @@ class UploadInteractiveView(UploadBaseView): else: user_id = None + label = file_object.name if 'document_type_available_filenames' in forms['document_form'].cleaned_data: if forms['document_form'].cleaned_data['document_type_available_filenames']: label = forms['document_form'].cleaned_data['document_type_available_filenames'].filename @@ -218,7 +219,7 @@ class UploadInteractiveView(UploadBaseView): task_upload_document.apply_async(kwargs=dict( source_id=self.source.pk, file_path=temporary_file.name, - label=label or file_object.name, + label=label, document_type_id=self.document_type.pk, expand=expand, metadata_dict_list=decode_metadata_from_url(self.request.GET),