fix: zentrale Lebensmittel fuer Admins aenderbar
Deploy Development / deploy (push) Successful in 1m7s
Build Test / pytest-backend (push) Successful in 5s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 23s

Persoenliche Liste bleibt beim Owner; zentrale Eintraege oeffnen den Admin-Editor. Admin-Katalog trennt beide Listen, persoenliche bleiben sichtbar.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-09-14 13:01:41 +02:00
1 parent 9a0767c8ac
commit e452d9a8fe
13 files changed
+134 -45

No files matched your search

+2 -2
View File
@@ -238,8 +238,8 @@ def get_food_detail(food_id: str, session: dict = Depends(require_auth)):
if not food:
raise HTTPException(404, "Lebensmittel nicht gefunden")
food = dict(food)
from data_layer.food_visibility import attach_visibility, same_id
editable = food.get("catalog_kind") == "manual_user" and same_id(food.get("owner_profile_id"), pid)
from data_layer.food_visibility import attach_visibility, can_edit_food
editable = can_edit_food(food, pid, is_admin=session.get("role") == "admin")
return attach_visibility(editor_payload_for_food(cur, food, editable=editable))