From f0ad1e1d56a0927f9bd0fe6fa3ff85440bff23df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Bournhonesque?= Date: Mon, 18 Dec 2023 13:33:36 +0100 Subject: [PATCH] fix: fix delete_images call --- robotoff/images.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/robotoff/images.py b/robotoff/images.py index 4a8c58465a..c9016c1176 100644 --- a/robotoff/images.py +++ b/robotoff/images.py @@ -254,8 +254,10 @@ def delete_images(product_id: ProductIdentifier, image_ids: list[str]): ImagePrediction.image == image_model ).execute() - updated_image_models: int = ImageModel.bulk_update( - updated_models, fields=["deleted"] + updated_image_models: int = ( + ImageModel.bulk_update(updated_models, fields=["deleted"]) + if updated_models + else 0 ) deleted_predictions: int = ( Prediction.delete()