Commit 5e5a6fd4 authored by okhin's avatar okhin 🚴

Let's just replace ' ' by '_'

parent af368ed4
......@@ -151,9 +151,9 @@ def sanitize_phonenumber(number):
bl_re = None
for blacklist in db.execute('SELECT pattern, reason FROM blacklist').fetchall():
if bl_re == None:
bl_re ='(?P<{reason}>^{pattern})'.format(pattern=blacklist[0],reason=blacklist[1],)
bl_re ='(?P<{reason}>^{pattern})'.format(pattern=blacklist[0].replace(' ', '_'),reason=blacklist[1],)
else:
bl_re +='|(?P<{reason}>^{pattern})'.format(pattern=blacklist[0], reason=blacklist[1],)
bl_re +='|(?P<{reason}>^{pattern})'.format(pattern=blacklist[0].replace(' ', '_'), reason=blacklist[1],)
if bl_re != None:
# We have blacklisted patterns, need to chck for them
groups = re.match(bl_re, number)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment