Fix crash when using limit in /api/packages/

Fixes #468
This commit is contained in:
rubenwardy 2023-09-02 21:52:14 +01:00
parent b6995b1857
commit d4ecaee5f2

@ -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())