Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Websites UFRPE
Django Private Storage
Commits
d70cba1e
Unverified
Commit
d70cba1e
authored
Nov 20, 2017
by
Diederik van der Boor
Committed by
GitHub
Nov 20, 2017
Browse files
Merge pull request #9 from shtalinberg/master
fix UnicodeDecodeError with cyrillic file names
parents
8f26e231
03eca312
Changes
1
Hide whitespace changes
Inline
Side-by-side
private_storage/fields.py
View file @
d70cba1e
...
...
@@ -9,7 +9,6 @@ from django.core.exceptions import ValidationError
from
django.core.files.uploadedfile
import
UploadedFile
from
django.db
import
models
from
django.template.defaultfilters
import
filesizeformat
from
django.utils.encoding
import
smart_str
from
django.utils.translation
import
ugettext_lazy
as
_
from
.storage
import
private_storage
...
...
@@ -71,4 +70,4 @@ class PrivateFileField(models.FileField):
if
not
subdirs
:
subdirs
=
[
self
.
get_directory_name
()]
dirs
=
list
(
subdirs
)
+
[
self
.
get_filename
(
filename
)]
return
smart_str
(
os
.
path
.
join
(
*
dirs
))
return
os
.
path
.
normpath
(
os
.
path
.
join
(
*
dirs
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment