From eef9e5eef17391af6fb245b8379b4eb3173c62f8 Mon Sep 17 00:00:00 2001 From: csd4ni3l Date: Fri, 15 Aug 2025 16:05:53 +0200 Subject: [PATCH] convert last_grass_touch_time to float so it can subtract in jinja2 --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index c7f5bb7..3d55210 100644 --- a/main.py +++ b/main.py @@ -272,7 +272,7 @@ def profile(): grass_touching_count, last_grass_touch_time = row - return render_template("profile.jinja2", username=username, grass_touching_count=grass_touching_count, last_grass_touch_time=last_grass_touch_time, now=time.time(), your_account=True) + return render_template("profile.jinja2", username=username, grass_touching_count=grass_touching_count, last_grass_touch_time=float(last_grass_touch_time), now=time.time(), your_account=True) @app.route("/profile/") def public_profile(username): @@ -289,7 +289,7 @@ def public_profile(username): grass_touching_count, last_grass_touch_time = row - return render_template("profile.jinja2", username=username, grass_touching_count=grass_touching_count, last_grass_touch_time=last_grass_touch_time, now=time.time(), your_account=False) + return render_template("profile.jinja2", username=username, grass_touching_count=grass_touching_count, last_grass_touch_time=float(last_grass_touch_time), now=time.time(), your_account=False) @app.route("/login", methods=["GET", "POST"]) def login():