X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/4b0a7ae59f46bd178745e97e6b69dc240c5761c7..ae60b2a3949e96357477cc04f90fd0873cee8a92:/apps/funding/utils.py?ds=inline diff --git a/apps/funding/utils.py b/apps/funding/utils.py deleted file mode 100644 index 2b5f58f4d..000000000 --- a/apps/funding/utils.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -import re -import string -from fnpdjango.utils.text.slughifi import char_map - -# PayU chokes on non-Polish diacritics. -# 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.digits + - ' ' + - "".join(set(string.punctuation) - set('\\')) -) - -def replace_char(m): - char = m.group() - return char_map.get(char, '') - -def sanitize_payment_title(value): - return re.sub('[^%s]{1}' % sane_in_payu_title, replace_char, unicode(value))