X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fdominate.py;h=52f1b17220cea6824e7b6d91deb3ba04e572ca9f;hb=17c5cab4eb8d5181ec7a81267a4e2e6b43c0fc65;hp=accb0df8f628efce999ad82121d8140565df4d66;hpb=f35892c66f10c6f072cc097519b0da05c63e1ee2;p=dak.git diff --git a/dak/dominate.py b/dak/dominate.py index accb0df8..52f1b172 100755 --- a/dak/dominate.py +++ b/dak/dominate.py @@ -84,14 +84,15 @@ def obsoleteAllAssociations(suite, session): return fetch('old_and_unreferenced', query, { 'suite': suite }, session) def deleteAssociations(table, idList, session): + global Options query = """ DELETE FROM %s - WHERE id = :id + WHERE id IN :idList """ % table - params = [{'id': id} for id in idList] - if len(params) == 0: + if not idList or Options['No-Action']: return + params = {'idList': tuple(idList)} session.execute(query, params) def doDaDoDa(suite, session):