-# -*- 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.
+# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
#
import re
import string
# 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('\\'))
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))