Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Dec 31, 2024
1 parent 0273b92 commit 5b36091
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions open_prices/proofs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,18 @@ def match_category_price_tag_with_category_price(
def match_price_tag_with_price(price_tag: PriceTag, price: Price) -> bool:
"""
Match only on price.
We make sure this price is unique.
We make sure this price is unique in the proof to avoid errors.
"""
price_tag_prediction_data = price_tag.predictions.first().data
price_tag_prediction_price = price_tag_prediction_data.get("price")
proof = price_tag.proof
proof_prices = list(proof.prices.values_list("price", flat=True))
proof_prices = list(
Price.objects.filter(proof_id=price_tag.proof_id).values_list(
"price", flat=True
)
)
proof_price_tag_prices = [
price_tag.predictions.first().data.get("price")
for price_tag in proof.price_tags.all()
for price_tag in PriceTag.objects.filter(proof_id=price_tag.proof_id)
]
return (
# (price_tag_prediction_data["product"] == "other")
Expand Down

0 comments on commit 5b36091

Please sign in to comment.