From: Roland Häder Date: Tue, 16 May 2023 23:44:58 +0000 (+0200) Subject: Also missed this SQL keywords X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=13eb7db0eace959f204bbac4ac036ce818be7927;p=fba.git Also missed this SQL keywords --- 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: