mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
server/search: fix negative offsets causing ISE
This commit is contained in:
@ -81,7 +81,7 @@ class Executor(object):
|
||||
filter_query = filter_query.options(sqlalchemy.orm.lazyload('*'))
|
||||
filter_query = self._prepare_db_query(filter_query, search_query, True)
|
||||
entities = filter_query \
|
||||
.offset((page - 1) * page_size) \
|
||||
.offset(max(page - 1, 0) * page_size) \
|
||||
.limit(page_size) \
|
||||
.all()
|
||||
|
||||
|
Reference in New Issue
Block a user