Sprint 14: Multi-Fix-Batch — SW by-v428, APP_VER 407
KI/Symptom-Check: JSON-Code-Fence stripping in ki.py, Dringlichkeit-Map mit Phosphor-Icons
Gewicht-Sync: health.js aktualisiert appState.activeDog.gewicht_kg auch bei Bearbeitung
Giftköder: icon:'check-circle' → UI.icon('check-circle') in emptyState-Call
Forum-Pills: overflow:hidden + text-overflow:ellipsis auf Desktop und Mobile
Moderation: Admins für Moderatoren unsichtbar, keine Aktions-Buttons auf Admins
Notizblock: Filter-Chips wrap 2-zeilig auf Desktop (min-width:1024px)
Tagebuch: Datenschutz-Hinweis "nur du kannst sie sehen", Sitter sieht keine bestehenden Einträge
diary.py: Sitter-Zugriff gibt leere Liste zurück (GET), Erstellen bleibt erlaubt
This commit is contained in:
parent
02120bb532
commit
016eb52d83
12 changed files with 111 additions and 33 deletions
|
|
@ -214,6 +214,18 @@ async def list_diary(dog_id: int, limit: int = 20, offset: int = 0,
|
|||
user=Depends(get_current_user)):
|
||||
with db() as conn:
|
||||
_can_read_dog(dog_id, user["id"], conn)
|
||||
# Sitter darf keine bestehenden Einträge lesen
|
||||
dog = conn.execute("SELECT user_id FROM dogs WHERE id=?", (dog_id,)).fetchone()
|
||||
is_owner = dog and dog["user_id"] == user["id"]
|
||||
if not is_owner:
|
||||
# Prüfen ob geteilter Hund (dog_shares) — darf lesen
|
||||
shared = conn.execute(
|
||||
"""SELECT 1 FROM dog_shares WHERE dog_id=? AND shared_with_id=? AND accepted_at IS NOT NULL""",
|
||||
(dog_id, user["id"])
|
||||
).fetchone()
|
||||
if not shared:
|
||||
# Weder Besitzer noch geteilter Nutzer → Sitter → leere Liste
|
||||
return []
|
||||
extra = "AND (d.is_milestone=1 OR d.typ='meilenstein')" if milestone else ""
|
||||
if q:
|
||||
pattern = f"%{q}%"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue