Skip to content

Commit 5fe9300

Browse files
authored
Merge pull request #79 from tutorcruncher/nulls-last
Improve webhooklog query
2 parents 428b08b + d605f4d commit 5fe9300

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

chronos/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
from fastapi import APIRouter, Depends, HTTPException
55
from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer
6+
from sqlalchemy import nullslast
67
from sqlalchemy.exc import NoResultFound
78
from sqlmodel import Session, select
89

@@ -183,7 +184,7 @@ async def get_logs(
183184
logs = db.exec(
184185
select(WebhookLog)
185186
.where(WebhookLog.webhook_endpoint_id == endpoint.id)
186-
.order_by(WebhookLog.timestamp.desc())
187+
.order_by(nullslast(WebhookLog.timestamp.desc()))
187188
.offset(offset)
188189
.limit(100)
189190
).all()

0 commit comments

Comments
 (0)