Browse Source

Korektury: odstraň diakritiku ze jména souboru

remotes/origin/korekturovatko_emaily
Matěj Kocián 8 years ago
parent
commit
a8a4364f60
  1. 6
      korektury/models.py
  2. 1
      requirements.txt

6
korektury/models.py

@ -10,10 +10,14 @@ from django.core.exceptions import ObjectDoesNotExist
import subprocess import subprocess
from reversion import revisions as reversion from reversion import revisions as reversion
from unidecode import unidecode
# PrilohaReseni method # PrilohaReseni method
def generate_filename(self, filename): def generate_filename(self, filename):
clean = filename.replace('/','-').replace('\0', '').replace(":","_") clean = unidecode(
filename.replace('/', '-').replace('\0', '').replace(":", "_")
)
fname = "%s_%s" % ( fname = "%s_%s" % (
timezone.now().strftime('%Y-%m-%d-%H_%M'), timezone.now().strftime('%Y-%m-%d-%H_%M'),
clean) clean)

1
requirements.txt

@ -8,6 +8,7 @@ pytz==2015.7
six==1.10.0 six==1.10.0
pexpect==4.0.1 pexpect==4.0.1
traitlets==4.0.0 traitlets==4.0.0
Unidecode==0.4.19
# Django and modules # Django and modules

Loading…
Cancel
Save