If where_args is not set, not using it in the delete request.
This commit is contained in:
Aurélien FUSIL-DELAHAYE 2017-07-07 16:36:42 +02:00
parent d8e9676fcf
commit 407b8f4bb3

View file

@ -147,9 +147,13 @@ def row_absent(name, db, table, where_sql, where_args=None):
changes['changes']['old'] = rows[0]
else:
cursor = conn.execute("DELETE FROM `" +
table + "` WHERE " + where_sql,
where_args)
if where_args is None:
cursor = conn.execute("DELETE FROM `" +
table + "` WHERE " + where_sql)
else:
cursor = conn.execute("DELETE FROM `" +
table + "` WHERE " + where_sql,
where_args)
conn.commit()
if cursor.rowcount == 1:
changes['result'] = True