server/search: fix negative offsets causing ISE
This commit is contained in:
parent
87b1ee4564
commit
48af5160df
1 changed files with 1 additions and 1 deletions
|
@ -81,7 +81,7 @@ class Executor(object):
|
||||||
filter_query = filter_query.options(sqlalchemy.orm.lazyload('*'))
|
filter_query = filter_query.options(sqlalchemy.orm.lazyload('*'))
|
||||||
filter_query = self._prepare_db_query(filter_query, search_query, True)
|
filter_query = self._prepare_db_query(filter_query, search_query, True)
|
||||||
entities = filter_query \
|
entities = filter_query \
|
||||||
.offset((page - 1) * page_size) \
|
.offset(max(page - 1, 0) * page_size) \
|
||||||
.limit(page_size) \
|
.limit(page_size) \
|
||||||
.all()
|
.all()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue