Commit e55bfe3d authored by okhin's avatar okhin 🚴

Merge branch '5-fix-unauthorized-calls' into 'master'

If re.groups does not match, they're of type None

See merge request !17
parents 63d7c47e 8f5397c0
Pipeline #941 passed with stage
in 4 seconds
......@@ -157,7 +157,7 @@ def sanitize_phonenumber(number):
if bl_re != None:
# We have blacklisted patterns, need to chck for them
groups = re.match(bl_re, number)
if len(groups) >= 1:
if groups is not None:
# We matched, so we're blacklisted
raise ValueException('{} is blacklisted. Reason: {}', (number, groups.groupdict().keys[0],))
return 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