Skip to content

Comments

logs: fix pagination of logs / user logs pages#236

Open
imrehg wants to merge 1 commit intoarchlinux:masterfrom
imrehg:logs-page-500
Open

logs: fix pagination of logs / user logs pages#236
imrehg wants to merge 1 commit intoarchlinux:masterfrom
imrehg:logs-page-500

Conversation

@imrehg
Copy link

@imrehg imrehg commented Feb 18, 2026

Flask-SQLAlchemy <3.0.0 allowed positional arguments for .paginate while 3.0.0 made all those arguments keyword only. This change adds the previously implict keywords to be explicit.

The previous pattern from the last 2.x version is here: https://github.com/pallets-eco/flask-sqlalchemy/blob/2.5.1/flask_sqlalchemy/__init__.py#L473-L492

    def paginate(self, page=None, per_page=None, error_out=True, max_per_page=None):

This means that the existign MAX_ENTRIES_PER_PAGE argument is a bit misleading, as it was was previously passed to per_page rather than the max_per_page argument. In this PR that behaviour is preserved to be conservative, but the intention is likely to change user.py to pass that argument to the max_per_page argument as the name intends?

The current format is here: https://github.com/pallets-eco/flask-sqlalchemy/blob/3.1.1/src/flask_sqlalchemy/query.py#L63-L97 showing that with 3.0 "All parameters are keyword-only."

    def paginate(
        self,
        *,
        page: int | None = None,
        per_page: int | None = None,
        max_per_page: int | None = None,
        error_out: bool = True,
        count: bool = True,
    )

Closes #225

Flask-SQLAlchemy <3.0.0 allowed positional arguments for `.paginate`
while 3.0.0 made all those arguments keyword only. This change adds the
previously implict keywords to be explicit.

Closes archlinux#225
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

https://security.archlinux.org/log always returns HTTP 500

1 participant