From 719b9d70008218b57c1f740135e8766908ddf6ec Mon Sep 17 00:00:00 2001 From: justinbaer Date: Thu, 26 Jun 2025 11:18:51 +0200 Subject: [PATCH] Query changes for DB --- .../controllers/patchnotes_controller.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gen/openapi_server/controllers/patchnotes_controller.py b/gen/openapi_server/controllers/patchnotes_controller.py index 568916e..bcb99e6 100644 --- a/gen/openapi_server/controllers/patchnotes_controller.py +++ b/gen/openapi_server/controllers/patchnotes_controller.py @@ -131,12 +131,7 @@ def list_patchnotes(since: str | None = None): logging.info("last_login" + str(last_login)) if since: logging.info("Went into if since") - query = { - "patch_date": { - "$gte": since, - "$lte": last_login - } - } + try: datetime.strptime(since, "%Y-%m-%d") except ValueError: @@ -145,7 +140,12 @@ def list_patchnotes(since: str | None = None): detail="since must be YYYY-MM-DD", status=400, ) - + query = { + "patch_date": { + "$gte": since, + "$lte": last_login.last_login + } + } # 3) Datum validieren (nur wenn vorhanden) elif since is None: