Skip to content

Commit

Permalink
Remove redundent if
Browse files Browse the repository at this point in the history
  • Loading branch information
uriyyo committed Sep 11, 2022
1 parent 7675f1e commit a3d3bca
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fastapi_pagination/ext/beanie.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional, TypeVar, Union, cast
from typing import Optional, TypeVar, Union

from beanie import Document
from beanie.odm.queries.find import FindMany
Expand All @@ -16,9 +16,6 @@ async def paginate(
params = resolve_params(params)
raw_params = params.to_raw_params()

if isinstance(query, Document):
query = cast(FindMany[TDocument], query.find_all())

items = await query.find_many(limit=raw_params.limit, skip=raw_params.offset).to_list()
total = await query.count()

Expand Down

0 comments on commit a3d3bca

Please sign in to comment.