From: Radek Czajka Date: Tue, 27 May 2014 07:34:01 +0000 (+0200) Subject: Another unicode/path fix. X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/3f961f9924a7b458e8ebb00b7135f013d52ce8d2?ds=sidebyside;hp=f2ed7d5158a1d6508b1382a384e32e22371a80b6 Another unicode/path fix. --- diff --git a/apps/fileupload/views.py b/apps/fileupload/views.py index cb7873b6..e4baf026 100644 --- a/apps/fileupload/views.py +++ b/apps/fileupload/views.py @@ -4,6 +4,7 @@ from urllib import quote from django.conf import settings from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden, Http404 from django.utils.decorators import method_decorator +from django.utils.encoding import smart_bytes from django.views.decorators.vary import vary_on_headers from django.views.generic import FormView, View from .forms import UploadForm @@ -74,6 +75,7 @@ class UploadView(FormView): Makes sure it's inside MEDIA_ROOT. """ + filename = smart_bytes(filename) path = os.path.abspath(os.path.join( settings.MEDIA_ROOT, self.get_directory(),