fix case where query broke on empty list

This commit is contained in:
Jimmy Zelinskie 2015-11-13 12:35:18 -05:00
parent 1d889b8f90
commit 09ce33e0dc

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())