mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Fix TypeError in offset calculation
sentry issue PRETIXEU-ZB
This commit is contained in:
@@ -82,7 +82,10 @@ class OrderSearch(PaginationMixin, ListView):
|
|||||||
|
|
||||||
page = self.kwargs.get(self.page_kwarg) or self.request.GET.get(self.page_kwarg) or 1
|
page = self.kwargs.get(self.page_kwarg) or self.request.GET.get(self.page_kwarg) or 1
|
||||||
limit = self.get_paginate_by(None)
|
limit = self.get_paginate_by(None)
|
||||||
offset = (page - 1) * limit
|
try:
|
||||||
|
offset = (int(page) - 1) * limit
|
||||||
|
except ValueError:
|
||||||
|
offset = 0
|
||||||
resultids = list(qs.order_by().values_list('id', flat=True)[:201])
|
resultids = list(qs.order_by().values_list('id', flat=True)[:201])
|
||||||
if len(resultids) <= 200 and len(resultids) <= offset + limit:
|
if len(resultids) <= 200 and len(resultids) <= offset + limit:
|
||||||
qs = Order.objects.using(settings.DATABASE_REPLICA).filter(
|
qs = Order.objects.using(settings.DATABASE_REPLICA).filter(
|
||||||
|
|||||||
Reference in New Issue
Block a user