Skip to content

Commit dcc3e0f

Browse files
authored
Merge pull request #59 from mmmnmnm/normalisename
Removing spec. chars from all media filenames
2 parents d5ba883 + d62ebd3 commit dcc3e0f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

arcsi/api/utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import unicodedata
32

43
from arcsi.handler.upload import AzuraArchive, DoArchive
54
from arcsi.model import db
@@ -33,8 +32,8 @@ def slug(namestring):
3332

3433

3534
def normalise(namestring):
36-
stripped = unicodedata.normalize("NFD", namestring).encode("ascii", "ignore")
37-
norms = stripped.decode("utf-8").lower().replace(" ", "_").replace("#", "_")
35+
slugged = slugify(namestring)
36+
norms = slugged.replace("-", "_")
3837
return norms
3938

4039

0 commit comments

Comments
 (0)