From e2e58db052e5d2a77b42540585d2fbcb0b2eb15b Mon Sep 17 00:00:00 2001 From: shasan Date: Tue, 15 Oct 2019 09:03:31 -0400 Subject: [PATCH] Changed code in order to account for backwards compatibility with cgi.Fieldstorage --- ckan/lib/uploader.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ckan/lib/uploader.py b/ckan/lib/uploader.py index 0045e766321..d814414de17 100644 --- a/ckan/lib/uploader.py +++ b/ckan/lib/uploader.py @@ -144,8 +144,9 @@ def update_data_dict(self, data_dict, url_field, file_field, clear_field): if not self.storage_path: return - if isinstance(self.upload_field_storage, (ALLOWED_UPLOAD_TYPES)): - if self.upload_field_storage: + if isinstance(self.upload_field_storage, (ALLOWED_UPLOAD_TYPES,)): + if self.upload_field_storage \ + and self.upload_field_storage.filename: self.filename = self.upload_field_storage.filename self.filename = str(datetime.datetime.utcnow()) + self.filename self.filename = munge.munge_filename_legacy(self.filename)