mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-05 01:16:27 +00:00
[Printer] Handles accentted filenames
This commit is contained in:
parent
5aa0dd867e
commit
4acb118268
2 changed files with 4 additions and 1 deletions
|
@ -19,3 +19,4 @@ graphviz
|
|||
git
|
||||
poppler-utils
|
||||
texlive-extra-utils
|
||||
python3-unidecode
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import subprocess
|
||||
import os
|
||||
import unidecode
|
||||
|
||||
def user_printing_path(instance, filename):
|
||||
"""
|
||||
|
@ -7,7 +9,7 @@ def user_printing_path(instance, filename):
|
|||
Currently MEDIA_ROOT/printings/user_<id>/<filename>
|
||||
"""
|
||||
# File will be uploaded to MEDIA_ROOT/printings/user_<id>/<filename>
|
||||
return 'printings/user_{0}/{1}'.format(instance.user.id, filename)
|
||||
return 'printings/user_{0}/{1}'.format(instance.user.id, unidecode.unidecode(filename))
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue