Fix: Keyset-Pagination use_keyset unabhaengig von cursor (erste Seite ohne cursor)

This commit is contained in:
Agent Zero
2026-08-03 19:21:19 +02:00
parent 5d35f0064e
commit 5863004727
+3 -3
View File
@@ -182,9 +182,9 @@ async def list_contacts(
Contact.search_tsv.op("@@")(func.plainto_tsquery("german", search))
)
# Keyset-Pagination: filter by cursor if provided
use_keyset = cursor is not None and sort_by == "id" and sort_order == "asc"
if use_keyset:
# Keyset-Pagination: use keyset when sorting by id (independent of cursor)
use_keyset = sort_by == "id" and sort_order == "asc"
if use_keyset and cursor is not None:
base = base.where(Contact.id > uuid.UUID(cursor))
# Count