diff --git a/app.py b/app.py index d34ccc9..d76763a 100644 --- a/app.py +++ b/app.py @@ -7,7 +7,7 @@ import os import io import qrcode import logging -from flask import Flask, render_template, g, send_file, request, jsonify +from flask import Flask, render_template, g, send_file, request # Configure logging, allowing override via LOG_LEVEL environment variable log_level = os.environ.get("LOG_LEVEL", "INFO").upper() @@ -117,10 +117,12 @@ def index(): # Redirect root to /adults for convenience while there are no other apps return '' -@app.route("/flush-cache", methods=["POST"]) +@app.route("/flush-cache", methods=["GET", "POST"]) def flush_cache_endpoint(): + if request.method == "GET": + return render_template("flush-cache.html") deleted = flush_cache() - return jsonify({"status": "ok", "deleted_files": deleted}) + return render_template("flush-cache.html", flushed=True, deleted=deleted) @app.route("/sync-bank") def sync_bank(): diff --git a/templates/adults.html b/templates/adults.html index e2de9c2..46a4ca2 100644 --- a/templates/adults.html +++ b/templates/adults.html @@ -467,6 +467,7 @@
diff --git a/templates/fees-juniors.html b/templates/fees-juniors.html index 1184682..d67a891 100644 --- a/templates/fees-juniors.html +++ b/templates/fees-juniors.html @@ -195,6 +195,7 @@ diff --git a/templates/fees.html b/templates/fees.html index 64d2eb8..de7b91f 100644 --- a/templates/fees.html +++ b/templates/fees.html @@ -210,6 +210,7 @@ diff --git a/templates/flush-cache.html b/templates/flush-cache.html new file mode 100644 index 0000000..7613e38 --- /dev/null +++ b/templates/flush-cache.html @@ -0,0 +1,167 @@ + + + + + + +Clears all cached Google Sheets data and resets refresh timers.
+ +