Merge pull request #874 from jzelinskie/fixemptylist

fix case where query broke on empty list
This commit is contained in:
Jimmy Zelinskie 2015-11-13 12:36:36 -05:00
commit 7d29cdd711

View file

@ -110,9 +110,13 @@ def _update_image(image, indexed, version):
.where(Image.docker_image_id == image['docker_image_id'],
ImageStorage.uuid == image['storage_uuid']))
ids_to_update = [row.id for row in query]
if not ids_to_update:
return
(Image
.update(security_indexed=indexed, security_indexed_engine=version)
.where(Image.id << [row.id for row in query])
.where(Image.id << ids_to_update)
.execute())