diff options
| author | rr- | 2016-08-15 18:04:40 +0200 |
|---|---|---|
| committer | rr- | 2016-08-16 17:22:33 +0200 |
| commit | 48af5160df4c1400204650f7000cb04d5c643659 (patch) | |
| tree | a55aa8f7bffa332b403f7016cb3f54a3dbb97399 | |
| parent | 87b1ee45640386282f0f70053d0f0155901b49e2 (diff) | |
server/search: fix negative offsets causing ISE
| -rw-r--r-- | server/szurubooru/search/executor.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/szurubooru/search/executor.py b/server/szurubooru/search/executor.py index 7f55fce..a4b0d44 100644 --- a/server/szurubooru/search/executor.py +++ b/server/szurubooru/search/executor.py @@ -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() |