X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/538526fc82b771cbc149743f129d8b1ae7e3cba2..e89f0663d3ef7ccbf2b51e400430695fb2421b6f:/src/funding/utils.py diff --git a/src/funding/utils.py b/src/funding/utils.py index 580833699..afebd8a74 100644 --- a/src/funding/utils.py +++ b/src/funding/utils.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # @@ -10,9 +9,9 @@ from fnpdjango.utils.text import char_map # Punctuation is handled correctly and escaped as needed, # with the notable exception of backslash. sane_in_payu_title = re.escape( - string.uppercase + - string.lowercase + - u'ąćęłńóśźżĄĆĘŁŃÓŚŹŻ' + + string.ascii_uppercase + + string.ascii_lowercase + + 'ąćęłńóśźżĄĆĘŁŃÓŚŹŻ' + string.digits + ' ' + "".join(set(string.punctuation) - set('\\')) @@ -25,4 +24,4 @@ def replace_char(m): def sanitize_payment_title(value): - return re.sub('[^%s]' % sane_in_payu_title, replace_char, unicode(value)) + return re.sub('[^%s]' % sane_in_payu_title, replace_char, str(value))