[PR #64] [CLOSED] Fix InvalidRequestError when page and limit set #114

Closed
opened 2026-02-26 01:33:16 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jeffknupp/sandman2/pull/64
Author: @snaplogic-nic
Created: 9/13/2017
Status: Closed

Base: masterHead: patch-1


📝 Commits (1)

  • 01a7b5b Fix InvalidRequestError when page and limit set

📊 Changes

1 file changed (+5 additions, -4 deletions)

View changed files

📝 sandman2/service.py (+5 -4)

📄 Description

The call to .paginate() includes an order_by in flask_sqlalchemy. When applied after a limit, this fails with sqlalchemy.exc.InvalidRequestError.
This change uses the per_page argument of .paginate() if the page query argument is set, or otherwise just applies the limit last.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jeffknupp/sandman2/pull/64 **Author:** [@snaplogic-nic](https://github.com/snaplogic-nic) **Created:** 9/13/2017 **Status:** ❌ Closed **Base:** `master` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`01a7b5b`](https://github.com/jeffknupp/sandman2/commit/01a7b5be57375e903a566c96b7e85413060e6abb) Fix InvalidRequestError when page and limit set ### 📊 Changes **1 file changed** (+5 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `sandman2/service.py` (+5 -4) </details> ### 📄 Description The call to .paginate() includes an order_by in flask_sqlalchemy. When applied after a limit, this fails with sqlalchemy.exc.InvalidRequestError. This change uses the per_page argument of .paginate() if the page query argument is set, or otherwise just applies the limit last. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 01:33:16 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/sandman2-jeffknupp#114
No description provided.