Skip to content

Commit

Permalink
fix: fix delete_images call
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Dec 18, 2023
1 parent 607f743 commit f0ad1e1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions robotoff/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit f0ad1e1

Please sign in to comment.