From: Ansgar Burchardt Date: Sat, 16 May 2015 13:19:35 +0000 (+0200) Subject: deleteAssociations: handle empty idList X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=ee560df0027a36537cc33c138a08c528346931f8;p=dak.git deleteAssociations: handle empty idList --- diff --git a/dak/dominate.py b/dak/dominate.py index 1c77ee66..449b9595 100755 --- a/dak/dominate.py +++ b/dak/dominate.py @@ -89,7 +89,10 @@ def deleteAssociations(table, idList, session): FROM %s WHERE id = :id """ % table - session.execute(query, [{'id': id} for id in idList]) + params = [{'id': id} for id in idList] + if len(params) == 0: + return + session.execute(query, params) def doDaDoDa(suite, session): # keep this part disabled because it is too dangerous