From 0658368aad41fc1adffbcec5a123c916472c038e Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 13 May 2023 15:40:03 +0100 Subject: [PATCH] Homepage: Fix tag counts including unapproved packages --- app/blueprints/homepage/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/blueprints/homepage/__init__.py b/app/blueprints/homepage/__init__.py index b46dd212..e8a77c52 100644 --- a/app/blueprints/homepage/__init__.py +++ b/app/blueprints/homepage/__init__.py @@ -54,7 +54,8 @@ def home(): downloads = 0 if not downloads_result or not downloads_result[0] else downloads_result[0] tags = db.session.query(func.count(Tags.c.tag_id), Tag) \ - .select_from(Tag).outerjoin(Tags).group_by(Tag.id).order_by(db.asc(Tag.title)).all() + .select_from(Tag).outerjoin(Tags).join(Package).filter(Package.state == PackageState.APPROVED)\ + .group_by(Tag.id).order_by(db.asc(Tag.title)).all() return render_template("index.html", count=count, downloads=downloads, tags=tags, featured=featured, new=new, updated=updated, pop_mod=pop_mod, pop_txp=pop_txp, pop_gam=pop_gam, high_reviewed=high_reviewed, reviews=reviews)