Skip to content

Commit

Permalink
fix(Django): fix daily import script (avoid unique_scans_n null). ref #…
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Sep 15, 2024
1 parent dab02ae commit 0656431
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions open_prices/common/openfoodfacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ def normalize_product_fields(product: JSONType) -> JSONType:
# If the product quantity is too high, it's probably an
# error, and may cause an OutOfRangeError in the database
product["product_quantity"] = None

# avoid null value in column "unique_scans_n" error
if not product.get("unique_scans_n"):
product["unique_scans_n"] = 0
return product


Expand Down

0 comments on commit 0656431

Please sign in to comment.