Query changes for DB

This commit is contained in:
Justin Weins 2025-06-26 11:18:51 +02:00
parent e3270d64bf
commit 719b9d7000
1 changed files with 7 additions and 7 deletions

View File

@ -131,12 +131,7 @@ def list_patchnotes(since: str | None = None):
logging.info("last_login" + str(last_login)) logging.info("last_login" + str(last_login))
if since: if since:
logging.info("Went into if since") logging.info("Went into if since")
query = {
"patch_date": {
"$gte": since,
"$lte": last_login
}
}
try: try:
datetime.strptime(since, "%Y-%m-%d") datetime.strptime(since, "%Y-%m-%d")
except ValueError: except ValueError:
@ -145,7 +140,12 @@ def list_patchnotes(since: str | None = None):
detail="since must be YYYY-MM-DD", detail="since must be YYYY-MM-DD",
status=400, status=400,
) )
query = {
"patch_date": {
"$gte": since,
"$lte": last_login.last_login
}
}
# 3) Datum validieren (nur wenn vorhanden) # 3) Datum validieren (nur wenn vorhanden)
elif since is None: elif since is None: