From 7db6c6bba4c02eb8fed3bb3e79515f42dc0715fd Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Thu, 22 Jul 2021 14:05:59 +0100 Subject: [PATCH] Fix missing state filter --- app/blueprints/api/endpoints.py | 2 +- app/blueprints/homepage/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/blueprints/api/endpoints.py b/app/blueprints/api/endpoints.py index fec79410..4735e324 100644 --- a/app/blueprints/api/endpoints.py +++ b/app/blueprints/api/endpoints.py @@ -364,7 +364,7 @@ def homepage(): query = Package.query.filter_by(state=PackageState.APPROVED) count = query.count() - featured = Package.query.filter(Package.tags.any(name="featured")).order_by( + featured = query.filter(Package.tags.any(name="featured")).order_by( func.random()).limit(6).all() new = query.order_by(db.desc(Package.approved_at)).limit(4).all() pop_mod = query.filter_by(type=PackageType.MOD).order_by(db.desc(Package.score)).limit(8).all() diff --git a/app/blueprints/homepage/__init__.py b/app/blueprints/homepage/__init__.py index a768590d..d5bc3cf6 100644 --- a/app/blueprints/homepage/__init__.py +++ b/app/blueprints/homepage/__init__.py @@ -18,7 +18,7 @@ def home(): query = Package.query.filter_by(state=PackageState.APPROVED) count = query.count() - featured = Package.query.filter(Package.tags.any(name="featured")).order_by(func.random()).limit(6).all() + featured = query.filter(Package.tags.any(name="featured")).order_by(func.random()).limit(6).all() new = join(query.order_by(db.desc(Package.approved_at))).limit(4).all() pop_mod = join(query.filter_by(type=PackageType.MOD).order_by(db.desc(Package.score))).limit(8).all()