Commit 8f5397c0 authored by okhin's avatar okhin
Browse files

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

parent 6af6747b
......@@ -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
Supports Markdown
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