Fix missing state filter

This commit is contained in:
rubenwardy 2021-07-22 14:05:59 +01:00
parent b87401a0c8
commit 7db6c6bba4
2 changed files with 2 additions and 2 deletions

@ -364,7 +364,7 @@ def homepage():
query = Package.query.filter_by(state=PackageState.APPROVED) query = Package.query.filter_by(state=PackageState.APPROVED)
count = query.count() 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() func.random()).limit(6).all()
new = query.order_by(db.desc(Package.approved_at)).limit(4).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() pop_mod = query.filter_by(type=PackageType.MOD).order_by(db.desc(Package.score)).limit(8).all()

@ -18,7 +18,7 @@ def home():
query = Package.query.filter_by(state=PackageState.APPROVED) query = Package.query.filter_by(state=PackageState.APPROVED)
count = query.count() 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() 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() pop_mod = join(query.filter_by(type=PackageType.MOD).order_by(db.desc(Package.score))).limit(8).all()