Fix bug in modelutil pagination that caused us to load far more results than necessary
Also adds tests for the modelutil pagination
This commit is contained in:
parent
e5b86d4763
commit
29058201e5
2 changed files with 51 additions and 2 deletions
|
@ -25,9 +25,8 @@ def paginate(query, model, descending=False, page_token=None, limit=50, id_alias
|
|||
query = query.where(model.id <= start_id)
|
||||
else:
|
||||
query = query.where(model.id >= start_id)
|
||||
else:
|
||||
query = query.limit(limit + 1)
|
||||
|
||||
query = query.limit(limit + 1)
|
||||
return paginate_query(query, limit=limit, id_alias=id_alias)
|
||||
|
||||
|
||||
|
|
Reference in a new issue