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()