From 405639329c59f9417806c869f823b956ca388ddc Mon Sep 17 00:00:00 2001 From: justinbaer Date: Thu, 26 Jun 2025 11:29:08 +0200 Subject: [PATCH] getting last_login changes --- gen/openapi_server/controllers/patchnotes_controller.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gen/openapi_server/controllers/patchnotes_controller.py b/gen/openapi_server/controllers/patchnotes_controller.py index bcb99e6..4fd75ef 100644 --- a/gen/openapi_server/controllers/patchnotes_controller.py +++ b/gen/openapi_server/controllers/patchnotes_controller.py @@ -125,7 +125,12 @@ def list_patchnotes(since: str | None = None): """GET /patchnotes – liefert neue Patchnotes und setzt last_login.""" user_id = current_user_id() # 1) aktueller Benutzer - last_login = last_login_collection.find_one({"user_id": user_id}, {"last_login"}) + last_login_doc = last_login_collection.find_one( + {"user_id": user_id}, + {"_id": 0, "last_login": 1} + ) + last_login = last_login_doc.get("last_login") if last_login_doc else None + query = {} logging.info("since" + str(since)) logging.info("last_login" + str(last_login)) @@ -143,7 +148,7 @@ def list_patchnotes(since: str | None = None): query = { "patch_date": { "$gte": since, - "$lte": last_login.last_login + "$lte": last_login } }