logger.debug("row[domain]='%s'", row["domain"])
if not validators.domain(row["domain"].split("/")[0], rfc_2782=True):
logger.info("Invalid row[domain]='%s' found, removing ...", row["domain"])
- database.cursor.execute("DELETE FROM blocks WHERE blocker = ? OR blocked = ?", [row["domain"], row["domain"]])
- database.cursor.execute("DELETE FROM instances WHERE domain = ? LIMIT 1", [row["domain"]])
+ blocks.delete(row["domain"])
+ instances.delete(row["domain"])
logger.debug("Invoking commit() ...")
database.connection.commit()
logger.debug("domain='%s' - CALLED!", domain)
domain_helper.raise_on(domain)
- database.cursor.execute(f"DELETE FROM blocks WHERE blocker = ?", [domain])
- database.cursor.execute(f"DELETE FROM blocks WHERE blocked = ?", [domain])
+ database.cursor.execute(f"DELETE FROM blocks WHERE blocker = ? OR blocked = ?", [domain, domain])
logger.debug("Invoking commit() ...")
database.connection.commit()