patchnotes controller updated
This commit is contained in:
parent
b6cfe62724
commit
4df2a1dede
|
|
@ -127,8 +127,18 @@ def list_patchnotes(since: str | None = None):
|
||||||
|
|
||||||
# 2) Wenn ?since fehlt, gespeichertes last_login holen
|
# 2) Wenn ?since fehlt, gespeichertes last_login holen
|
||||||
if since is None:
|
if since is None:
|
||||||
rec = last_login_collection.find_one({"user_id": user_id})
|
try:
|
||||||
since = rec["last_login"] if rec else None
|
docs = list(collection.sort("patch_date", 1))
|
||||||
|
for d in docs:
|
||||||
|
d.pop("_id", None)
|
||||||
|
if isinstance(d["patch_date"], (datetime, date)):
|
||||||
|
d["patch_date"] = d["patch_date"].isoformat()
|
||||||
|
except ValueError as e:
|
||||||
|
raise ProblemException(
|
||||||
|
title="Internal Server Error",
|
||||||
|
detail=str(e),
|
||||||
|
status=500,
|
||||||
|
)
|
||||||
|
|
||||||
# 3) Datum validieren (nur wenn vorhanden)
|
# 3) Datum validieren (nur wenn vorhanden)
|
||||||
if since:
|
if since:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue