Skip to content

Commit

Permalink
Add report button to account deletion section
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenwardy committed Jul 23, 2024
1 parent e603f29 commit bb2a1f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app/blueprints/report/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
6 changes: 4 additions & 2 deletions app/templates/users/account.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ <h3 class="mt-5">{{ _("Account Deletion and Deactivation") }}</h3>
{% else %}
<p>
{{ _("Account Deletion and Deactivation isn't available to users yet.") }}
{{ _("Please contact the admin.") }}
{{ _("Please raise a report to request account deletion.") }}
</p>
<p>
<a class="btn btn-secondary" href="{{ url_for('report.report', url=url_current(), message="Delete my account") }}">{{ _("Report") }}</a>
</p>
{% endif %}


<h3 class="mt-5">{{ _("Recent Account Actions") }}</h3>

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

0 comments on commit bb2a1f3

Please sign in to comment.