From c29326745b4523fc2ede619a02a4e7d3580d918b Mon Sep 17 00:00:00 2001 From: Mint <> Date: Mon, 27 Feb 2023 01:08:33 +0300 Subject: [PATCH] Handle it both sides --- api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api.py b/api.py index 43967e4..d120688 100644 --- a/api.py +++ b/api.py @@ -136,13 +136,14 @@ def mutual(domains: list[str] = Query()): c = conn.cursor() c.execute( "SELECT block_level FROM blocks " \ - "WHERE ((blocker = :a OR blocker = :b) AND (blocked = :b OR blocked = :a OR blocked = :w)) " \ + "WHERE ((blocker = :a OR blocker = :b) AND (blocked = :b OR blocked = :a OR blocked = :aw OR blocked = :bw)) " \ "AND block_level = 'reject' " \ "LIMIT 1", { "a": domains[0], - "w": "*." + domains[0], "b": domains[1], + "aw": "*." + domains[0], + "bw": "*." + domains[1], }, ) res = c.fetchone() -- 2.39.5