diff --git a/magneticow/magneticow/magneticow.py b/magneticow/magneticow/magneticow.py index cccc3cd..169650c 100644 --- a/magneticow/magneticow/magneticow.py +++ b/magneticow/magneticow/magneticow.py @@ -71,13 +71,10 @@ def home_page(): context = {} with magneticod_db: - cur = magneticod_db.execute( - "SELECT" - " count(id) " - "FROM torrents ;") - context["counter"] = cur.fetchall() + cur = magneticod_db.execute("SELECT count() FROM torrents ;") + n_torrents = cur.fetchone()[0] - return flask.render_template("homepage.html",**context) + return flask.render_template("homepage.html",n_torrents=n_torrents) @app.route("/torrents/") diff --git a/magneticow/magneticow/templates/homepage.html b/magneticow/magneticow/templates/homepage.html index 6ad415e..475a1f0 100644 --- a/magneticow/magneticow/templates/homepage.html +++ b/magneticow/magneticow/templates/homepage.html @@ -17,7 +17,7 @@