]> git.decadent.org.uk Git - dak.git/commitdiff
deleteAssociations: handle empty idList
authorAnsgar Burchardt <ansgar@debian.org>
Sat, 16 May 2015 13:19:35 +0000 (15:19 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Sat, 16 May 2015 13:19:35 +0000 (15:19 +0200)
dak/dominate.py

index 1c77ee66b09cf74476721350128db3c16bdb6a13..449b9595949f5cf830a8a9c130b56b00e7655357 100755 (executable)
@@ -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