latest changes

This commit is contained in:
Joren de Graaf
2026-10-22 10:32:41 +02:00
parent 5799b542c8
commit 5b986134be
63 changed files with 2412 additions and 77 deletions
+1
View File
@@ -147,6 +147,7 @@ def cached_product(user, barcode, *, refresh=False):
raise ValueError('Enter a numeric barcode.')
product = FoodProduct.objects.filter(owner=user, barcode=barcode).first()
if product and (product.source == FoodProduct.Source.MANUAL or
(isinstance(product.raw_data, dict) and product.raw_data.get('manual_nutrition_override')) or
(not refresh and product.fetched_at and product.fetched_at >= timezone.now() - timedelta(days=7))):
return product
if not settings.OPENFOODFACTS_ENABLED: