From 13eb7db0eace959f204bbac4ac036ce818be7927 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 17 May 2023 01:44:58 +0200 Subject: [PATCH] Also missed this SQL keywords --- fetch_blocks.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fetch_blocks.py b/fetch_blocks.py index aa09da5..4bbe4ea 100644 --- a/fetch_blocks.py +++ b/fetch_blocks.py @@ -284,7 +284,7 @@ for blocker, software in c.fetchall(): }) else: c.execute( - "UPDATE blocks set last_seen = ? WHERE blocker = ? AND blocked = ? AND block_level = ?", + "UPDATE blocks SET last_seen = ? WHERE blocker = ? AND blocked = ? AND block_level = ?", (timestamp, blocker, blocked, block_level) ) conn.commit() @@ -309,7 +309,7 @@ for blocker, software in c.fetchall(): if searchres != None: blocked = searchres[0] c.execute( - "UPDATE blocks set reason = ? WHERE blocker = ? AND blocked = ? AND block_level = ? AND reason = ''", + "UPDATE blocks SET reason = ? WHERE blocker = ? AND blocked = ? AND block_level = ? AND reason = ''", (reason["reason"], blocker, blocked, block_level), ) for entry in blockdict: @@ -405,12 +405,12 @@ for blocker, software in c.fetchall(): }) else: c.execute( - "UPDATE blocks set last_seen = ? WHERE blocker = ? AND blocked = ? AND block_level = ?", + "UPDATE blocks SET last_seen = ? WHERE blocker = ? AND blocked = ? AND block_level = ?", (timestamp, blocker, blocked if blocked.count("*") <= 1 else blocked_hash, block_level), ) if reason != '': c.execute( - "UPDATE blocks set reason = ? WHERE blocker = ? AND blocked = ? AND block_level = ? AND reason = ''", + "UPDATE blocks SET reason = ? WHERE blocker = ? AND blocked = ? AND block_level = ? AND reason = ''", (reason, blocker, blocked if blocked.count("*") <= 1 else blocked_hash, block_level), ) conn.commit() @@ -480,12 +480,12 @@ for blocker, software in c.fetchall(): }) else: c.execute( - "UPDATE blocks set last_seen = ? WHERE blocker = ? AND blocked = ? AND block_level = ?", + "UPDATE blocks SET last_seen = ? WHERE blocker = ? AND blocked = ? AND block_level = ?", (timestamp, blocker, blocked, block_level), ) if reason != '': c.execute( - "UPDATE blocks set reason = ? WHERE blocker = ? AND blocked = ? AND block_level = ? AND reason = ''", + "UPDATE blocks SET reason = ? WHERE blocker = ? AND blocked = ? AND block_level = ? AND reason = ''", (reason, blocker, blocked, block_level), ) conn.commit() @@ -535,13 +535,13 @@ for blocker, software in c.fetchall(): }) else: c.execute( - "UPDATE blocks set last_seen = ? WHERE blocker = ? AND blocked = ? AND block_level = ?", + "UPDATE blocks SET last_seen = ? WHERE blocker = ? AND blocked = ? AND block_level = ?", (timestamp, blocker, blocked, "reject"), ) if "public_comment" in peer: reason = peer["public_comment"] c.execute( - "UPDATE blocks set reason = ? WHERE blocker = ? AND blocked = ? AND block_level = ? AND reason = ''", + "UPDATE blocks SET reason = ? WHERE blocker = ? AND blocked = ? AND block_level = ? AND reason = ''", (reason, blocker, blocked, "reject"), ) for entry in blockdict: -- 2.39.5