Query changes for DB
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user