fix: ruff warnings

This commit is contained in:
2026-07-28 13:55:31 +02:00
committed by d3vyce
parent a407677be0
commit fd83a7142d
36 changed files with 255 additions and 138 deletions
+4 -5
View File
@@ -1580,11 +1580,10 @@ class AsyncCrud(Generic[ModelType]):
# prev_cursor: points before the first item in ascending order
prev_cursor: str | None = None
if direction is _CursorDirection.NEXT and cursor is not None and items_page:
prev_cursor = _encode_cursor(
getattr(items_page[0], cursor_col_name), direction=_CursorDirection.PREV
)
elif direction is _CursorDirection.PREV and has_more and items_page:
if items_page and (
(direction is _CursorDirection.NEXT and cursor is not None)
or (direction is _CursorDirection.PREV and has_more)
):
prev_cursor = _encode_cursor(
getattr(items_page[0], cursor_col_name), direction=_CursorDirection.PREV
)