Skip to content

Commit 5db4ee7

Browse files
authored
Fix issue with order by raise 500 for piccolo ext (#876)
1 parent 08dd73f commit 5db4ee7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fastapi_pagination/ext/piccolo.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ async def paginate(
3434
# need another copy for count query
3535
count_query = deepcopy(query)
3636
count_query.columns_delegate.selected_columns = []
37+
# reset order by to avoid errors in count query
38+
count_query.order_by_delegate._order_by.order_by_items = [] # noqa
3739

3840
total = None
3941
if row := await count_query.columns(Count()).first():

0 commit comments

Comments
 (0)