From 3565058eea6f2ec8f47b0afce068ed0c5e801981 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Thu, 24 May 2018 20:42:26 +0100 Subject: Fix package count on home page --- app/views/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/__init__.py b/app/views/__init__.py index 28fb518..37474de 100644 --- a/app/views/__init__.py +++ b/app/views/__init__.py @@ -43,8 +43,10 @@ def send_upload(path): @app.route("/") @menu.register_menu(app, ".", "Home") def home_page(): - packages = Package.query.filter_by(approved=True).order_by(db.desc(Package.created_at)).limit(15).all() - return render_template("index.html", packages=packages) + query = Package.query.filter_by(approved=True) + count = query.count() + packages = query.order_by(db.desc(Package.created_at)).limit(15).all() + return render_template("index.html", packages=packages, count=count) from . import users, githublogin, packages, sass, tasks, admin, notifications -- cgit v1.2.3