fix(P-13): leserliche Journals, readOnly-Felder, Meldungs-Badge auf Medienkacheln
Deploy Development / deploy (push) Successful in 37s
Test Suite / pytest-backend (push) Failing after 36s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 10s
Test Suite / playwright-tests (push) Successful in 56s
Deploy Development / deploy (push) Successful in 37s
Test Suite / pytest-backend (push) Failing after 36s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 10s
Test Suite / playwright-tests (push) Successful in 56s
- ReportContentModal: Name/E-Mail readOnly fuer eingeloggte Nutzer - MediaLibraryPage: content_report_filed im Journal leserlich (Meldegrund, Prioritaet, Status DE) - MediaLibraryPage: Badge auf Medienkacheln zeigt offene Meldungsanzahl (nur Admins) - media_assets.py: open_report_count Subquery fuer Admin-Sicht in Listendaten - Inbox-500-Fix: ma.media_kind -> ma.mime_type (alle 3 Stellen) - PATCH content_reports: Statuswechsel wird in Audit-Log protokolliert - E-Mails: Dateiname statt Medium-ID, lesbarer Inhalt version: 0.8.91 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
8dd748e7d9
commit
bb4d927090
6 files changed
+151
-23
No files matched your search
@@ -1168,10 +1168,26 @@ def list_media_assets(
|
||||
show_club = sup or is_adm or bool(admin_club_ids)
|
||||
asset_ids = [int(r["id"]) for r in rows]
|
||||
usage_map = _usage_for_media_assets(cur, asset_ids)
|
||||
# open_report_count: nur für Admins relevant; immer befüllen (0 für normale Nutzer ok)
|
||||
report_count_map: dict[int, int] = {}
|
||||
if asset_ids and (is_adm or bool(admin_club_ids)):
|
||||
cur.execute(
|
||||
"""SELECT target_id, COUNT(*) AS cnt
|
||||
FROM content_reports
|
||||
WHERE target_type = 'media_asset'
|
||||
AND target_id = ANY(%s)
|
||||
AND status IN ('submitted', 'under_review')
|
||||
GROUP BY target_id""",
|
||||
(asset_ids,),
|
||||
)
|
||||
for row in cur.fetchall():
|
||||
rd = r2d(row)
|
||||
report_count_map[int(rd["target_id"])] = int(rd["cnt"])
|
||||
for r in rows:
|
||||
r["permissions"] = _item_permissions(r, tenant, admin_club_ids)
|
||||
tid = int(r["id"])
|
||||
r["usage"] = usage_map.get(tid, {"exercises": [], "training_units": []})
|
||||
r["open_report_count"] = report_count_map.get(tid, 0)
|
||||
tags_val = r.get("tags")
|
||||
if tags_val is None:
|
||||
r["tags"] = []
|
||||
|
||||
Reference in new issue
Block a user