From 4fae41c463718d5cad9f27cbfeb2154082f53cbc Mon Sep 17 00:00:00 2001 From: j Date: Sun, 28 May 2017 13:40:56 +0200 Subject: [PATCH] extension should always be lowercase --- pandora/document/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandora/document/views.py b/pandora/document/views.py index 700527fc0..a7ab05769 100644 --- a/pandora/document/views.py +++ b/pandora/document/views.py @@ -388,6 +388,7 @@ def upload(request): else: file = None name, extension = request.POST['filename'].rsplit('.', 1) + extension = extension.lower() response = json_response(status=400, text='this request requires POST') if 'chunk' in request.FILES: if file.editable(request.user): @@ -399,7 +400,7 @@ def upload(request): #init upload else: if not file: - file = models.Document(user=request.user, extension=extension) + file = models.Document(user=request.user) file.data['title'] = name file.extension = extension file.uploading = True @@ -411,7 +412,7 @@ def upload(request): file.file.delete() file.uploading = True name, extension = request.POST['filename'].rsplit('.', 1) - file.extension = extension.lower() + file.extension = extension file.width = -1 file.pages = -1 file.save()