From c34e73d5839b5465dd2c1cdc5a4d25614ff50e82 Mon Sep 17 00:00:00 2001 From: csd4ni3l Date: Sat, 9 Aug 2025 14:19:58 +0200 Subject: [PATCH] revert to not using flashed messages --- main.py | 5 ++--- templates/unathorized.jinja2 | 13 ------------- 2 files changed, 2 insertions(+), 16 deletions(-) delete mode 100644 templates/unathorized.jinja2 diff --git a/main.py b/main.py index 36863d5..dd4e426 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,4 @@ -from flask import Flask, redirect, url_for, render_template, request, Response, send_from_directory, g, flash, get_flashed_messages +from flask import Flask, redirect, url_for, render_template, request, Response, send_from_directory, g from dotenv import load_dotenv from constants import RICKROLL_LINK, UPLOAD_DIR, MINIMUM_COSINE_SIMILARITY, DATABASE_FILE from jina import get_grass_touching_similarity @@ -86,8 +86,7 @@ def login(): return redirect(url_for("iamarealpersonwhotouchedgrass")) else: cur.close() - flash("Unathorized access. Just go outside, touch grass and make your own account...", "error") - return render_template("unathorized.jinja2") + return Response("Unathorized access. Just go outside, touch grass and make your own account...", 401) @app.route("/register", methods=["GET", "POST"]) def register(): diff --git a/templates/unathorized.jinja2 b/templates/unathorized.jinja2 deleted file mode 100644 index 44e4c2d..0000000 --- a/templates/unathorized.jinja2 +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "base.jinja2" %} -{% block title %}Grass Touching Unathorized{% endblock %} - -{% block body %} -{% with messages = get_flashed_messages()%} -{% if messages%} - {% for message in messages%} -

{{message}}

- {%endfor%} - {%endif%} - {%endwith%} - -{% endblock %} \ No newline at end of file