Skip to content

Commit

Permalink
Another unicode/path fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
rczajka committed May 27, 2014
1 parent f2ed7d5 commit 3f961f9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/fileupload/views.py
Expand Up @@ -4,6 +4,7 @@
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
Expand Down Expand Up @@ -74,6 +75,7 @@ def get_safe_path(self, filename=""):
Makes sure it's inside MEDIA_ROOT.
"""
filename = smart_bytes(filename)
path = os.path.abspath(os.path.join(
settings.MEDIA_ROOT,
self.get_directory(),
Expand Down

0 comments on commit 3f961f9

Please sign in to comment.