diff --git a/backend/main.py b/backend/main.py index 9a96f91..c42e324 100644 --- a/backend/main.py +++ b/backend/main.py @@ -1644,11 +1644,14 @@ def my_contribution(user=Depends(get_current_user)): (f'%"from_user": "{display}"%',) ).fetchall() adopted_names = list(set(r["target_name"] for r in adopted_rows if r["target_name"])) - # pending: recipes still owned by user in public library - pending_rows = conn.execute( - "SELECT name FROM recipes WHERE owner_id = ?", (user["id"],) - ).fetchall() - pending_names = [r["name"] for r in pending_rows] + # pending: recipes still owned by user in public library (skip admin — admin owns all public recipes) + if user.get("role") == "admin": + pending_names = [] + else: + pending_rows = conn.execute( + "SELECT name FROM recipes WHERE owner_id = ?", (user["id"],) + ).fetchall() + pending_names = [r["name"] for r in pending_rows] # rejected: unique recipe names rejected (not already adopted or pending) rejected_rows = conn.execute( "SELECT DISTINCT target_name FROM audit_log WHERE action = 'reject_recipe' AND detail LIKE ?",