From d4ecaee5f25a8e4b0c9268c23e6be3214f97a085 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 2 Sep 2023 21:52:14 +0100 Subject: [PATCH] Fix crash when using limit in /api/packages/ Fixes #468 --- app/blueprints/api/endpoints.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/blueprints/api/endpoints.py b/app/blueprints/api/endpoints.py index 557dded0..16d2dbf8 100644 --- a/app/blueprints/api/endpoints.py +++ b/app/blueprints/api/endpoints.py @@ -77,7 +77,10 @@ def packages(): pkgs = [pkg for pkg in pkgs if pkg.get("release")] # Promote featured packages - if "sort" not in request.args and "order" not in request.args and "q" not in request.args: + if "sort" not in request.args and \ + "order" not in request.args and \ + "q" not in request.args and \ + "limit" not in request.args: featured_lut = set() featured = qb.convert_to_dictionary(query.filter( Package.collections.any(and_(Collection.name == "featured", Collection.author.has(username="ContentDB")))).all())