diff --git a/data/model/image.py b/data/model/image.py index 8c437e3fc..70058c8c9 100644 --- a/data/model/image.py +++ b/data/model/image.py @@ -460,19 +460,9 @@ def get_image_with_storage_and_parent_base(): def set_secscan_status(image, indexed, version): - query = (Image - .select() - .join(ImageStorage) - .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 False - return (Image .update(security_indexed=indexed, security_indexed_engine=version) - .where(Image.id << ids_to_update) + .where(Image.id == image.id) .where((Image.security_indexed_engine != version) | (Image.security_indexed != indexed)) .execute()) != 0