X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/b2d342589a7889a3b096e7192453d53bd28eed7d..16358b72e70a109652609551c0ad89aec28fc58b:/src/sortify.py?ds=inline diff --git a/src/sortify.py b/src/sortify.py index f1e8bcb8b..941f50f1f 100644 --- a/src/sortify.py +++ b/src/sortify.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import re -from fnpdjango.utils.text.slughifi import char_map +from fnpdjango.utils.text import char_map # Specifies diacritics order. @@ -33,8 +33,8 @@ def sortify(value): """ - if not isinstance(value, unicode): - value = unicode(value, 'utf-8') + if not isinstance(value, str): + value = str(value, 'utf-8') # try to replace chars value = re.sub('[^a-zA-Z0-9\\s\\-]', replace_char, value)