From 50efdd86d3fb6d44d86b1250d64de356235134ac Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 10 Dec 2023 05:06:26 +0100 Subject: [PATCH] Continued: - formatted SQL statements --- daemon.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/daemon.py b/daemon.py index dc29823..3865980 100755 --- a/daemon.py +++ b/daemon.py @@ -472,7 +472,11 @@ def rss(request: Request, domain: str = None): wildchar = "*." + ".".join(domain.split(".")[-domain.count("."):]) punycode = domain.encode("idna").decode("utf-8") - database.cursor.execute("SELECT blocker, blocked, block_level, reason, first_seen, last_seen FROM blocks WHERE blocked = ? OR blocked = ? OR blocked = ? OR blocked = ? OR blocked = ? OR blocked = ? ORDER BY first_seen DESC LIMIT ?", [ + database.cursor.execute("SELECT blocker, blocked, block_level, reason, first_seen, last_seen +FROM blocks +WHERE blocked = ? OR blocked = ? OR blocked = ? OR blocked = ? OR blocked = ? OR blocked = ? +ORDER BY first_seen DESC +LIMIT ?", [ domain, "*." + domain, wildchar, utils.get_hash(domain), @@ -481,7 +485,10 @@ def rss(request: Request, domain: str = None): config.get("rss_limit") ]) else: - database.cursor.execute("SELECT blocker, blocked, block_level, reason, first_seen, last_seen FROM blocks ORDER BY first_seen DESC LIMIT ?", [config.get("rss_limit")]) + database.cursor.execute("SELECT blocker, blocked, block_level, reason, first_seen, last_seen +FROM blocks +ORDER BY first_seen DESC +LIMIT ?", [config.get("rss_limit")]) result = database.cursor.fetchall() blocklist = [] -- 2.39.5