Add API: URLs, token auth, what-can-i-cook endpoint, log-cook with pantry deduction, browsable API
This commit is contained in:
+6
-2
@@ -205,8 +205,12 @@ def what_can_i_cook(request):
|
||||
warnings = get_pantry_warnings(base.ingredient_id)
|
||||
|
||||
if available < needed:
|
||||
if base.ingredient.is_staple_ingredient:
|
||||
# Staples like oil/salt — assume always available even if tracking says 0
|
||||
# Check if this ingredient is tracked as a staple in the pantry
|
||||
is_staple = PantryItem.objects.filter(
|
||||
ingredient=base.ingredient, is_staple=True
|
||||
).exists()
|
||||
if is_staple:
|
||||
# Staples like oil/salt — assume always available
|
||||
pass
|
||||
else:
|
||||
recipe_result["base_missing"].append({
|
||||
|
||||
Reference in New Issue
Block a user