Commit d275c55c authored by okhin's avatar okhin 🚴

Merge branch '9-need-to-fix-some-parsing-in-the-blacklist-operations' into 'master'

Not mixing up reason and pattern should works best

See merge request !23
parents e787cd79 3233c472
Pipeline #954 passed with stage
in 5 seconds
......@@ -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].replace(' ', '_'),reason=blacklist[1],)
bl_re ='(?P<{reason}>^{pattern})'.format(pattern=blacklist[0], reason=blacklist[1].replace(' ', '_'),)
else:
bl_re +='|(?P<{reason}>^{pattern})'.format(pattern=blacklist[0].replace(' ', '_'), reason=blacklist[1],)
bl_re +='|(?P<{reason}>^{pattern})'.format(pattern=blacklist[0], reason=blacklist[1].replace(' ', '_'),)
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