From bb2a1f36386f2b9a4ddf27919f6885e58a313bed Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Tue, 23 Jul 2024 22:11:48 +0100 Subject: [PATCH] Add report button to account deletion section --- app/blueprints/report/__init__.py | 3 +++ app/templates/users/account.html | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/blueprints/report/__init__.py b/app/blueprints/report/__init__.py index dcc22f04..bfc8c1a4 100644 --- a/app/blueprints/report/__init__.py +++ b/app/blueprints/report/__init__.py @@ -47,6 +47,9 @@ def report(): url = abs_url_samesite(url) form = ReportForm(formdata=request.form) if current_user.is_authenticated else None + if request.method == "GET": + form.message.data = request.args.get("message", "") + if form and form.validate_on_submit(): if current_user.is_authenticated: user_info = f"{current_user.username}" diff --git a/app/templates/users/account.html b/app/templates/users/account.html index bb32bb9b..d67482cc 100644 --- a/app/templates/users/account.html +++ b/app/templates/users/account.html @@ -85,11 +85,13 @@ {% else %}

{{ _("Account Deletion and Deactivation isn't available to users yet.") }} - {{ _("Please contact the admin.") }} + {{ _("Please raise a report to request account deletion.") }} +

+

+ {{ _("Report") }}

{% endif %} -

{{ _("Recent Account Actions") }}

{% from "macros/audit_log.html" import render_audit_log %}