Do not crash if delete() is called with an empty list. #050182

This commit is contained in:
Albert Cervera i Areny 2022-03-11 14:22:25 +01:00
parent 264297b4d1
commit 1a8c781e2e
1 changed files with 4 additions and 3 deletions

View File

@ -80,9 +80,10 @@ class Party(metaclass=PoolMeta):
super(Party, cls).delete(parties)
cursor.execute(*party_company.delete(
where=(party_company.party.in_(party_ids))
))
if party_ids:
cursor.execute(*party_company.delete(
where=(party_company.party.in_(party_ids))
))
def get_current_company(self, name):
pool = Pool()