Merge pull request #874 from jzelinskie/fixemptylist
fix case where query broke on empty list
This commit is contained in:
commit
7d29cdd711
1 changed files with 5 additions and 1 deletions
|
@ -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())
|
||||
|
||||
|
||||
|
|
Reference in a new issue