]> git.0d.be Git - django-panik-nonstop.git/commitdiff
fix utf-8 encoding of filenames
authorFrédéric Péters <fpeters@0d.be>
Fri, 9 Feb 2018 17:34:54 +0000 (18:34 +0100)
committerFrédéric Péters <fpeters@0d.be>
Fri, 9 Feb 2018 17:34:54 +0000 (18:34 +0100)
nonstop/views.py

index f70333dad30297db2000e43d39c235771fe88c0b..3eecbe3b01a4a3b3b3ed7222e8bb3fef9f4367e2 100644 (file)
@@ -203,9 +203,9 @@ class UploadTracksView(FormView):
                 datetime.datetime.today().strftime('%y%m%d'),
                 artist_name[:50].replace('/', ' ').strip(),
                 track_title[:80].replace('/', ' ').strip(),
-                os.path.splitext(f.name)[-1]).encode('utf-8')
+                os.path.splitext(f.name)[-1])
 
-            default_storage.save(os.path.join('nonstop', 'tracks', filepath), content=f)
+            default_storage.save(os.path.join('nonstop', 'tracks', filepath.encode('utf-8')), content=f)
 
             nonstop_file = NonstopFile()
             nonstop_file.set_track_filepath(filepath)