Commit 07d00b4b authored by okhin's avatar okhin 🚴

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

Correct syntax for with statement

See merge request !15
parents 2f3bdf6f c271b573
Pipeline #939 passed with stage
in 4 seconds
......@@ -149,7 +149,7 @@ def sanitize_phonenumber(number):
# We're checking if we're blacklisted
db = sqlite3.connect(config['piphone']['db'])
bl_re = None
with blacklist in db.execute('SELECT pattern, reason FROM blacklist').fetchall():
with db.execute('SELECT pattern, reason FROM blacklist').fetchall() as blacklist:
if bl_re == None:
bl_re ='(?P<{reason}>^{pattern})'.format(pattern=blacklist[0],reason=blacklist[1],)
else:
......
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