From: Roland Häder Date: Sun, 10 Dec 2023 04:06:26 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=50efdd86d3fb6d44d86b1250d64de356235134ac;p=fba.git Continued: - formatted SQL statements --- 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 = []