Commit 63d7c47e authored by okhin's avatar okhin 🚴

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

Let's use a for … in … instead of a with … as …

See merge request !16
parents 07d00b4b 6af6747b
Pipeline #940 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 db.execute('SELECT pattern, reason FROM blacklist').fetchall() as blacklist:
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],)
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