Skip to content

Commit d744d05

Browse files
authored
Added a button to disable 2FA for a specific user (#4747)
Fixes #4746. Adds a button to the user edit view that allows for disabling of 2FA. Instead of it being on the form, it's in the actions bar.
1 parent df928ec commit d744d05

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

  • hypha/apply/users/templates/wagtailusers/users

hypha/apply/users/templates/wagtailusers/users/edit.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
{% extends "wagtailusers/users/edit.html" %}
2+
{% load users_tags i18n %}
3+
4+
{% block actions %}
5+
{{ block.super }}
6+
{% user_2fa_enabled user as is_2fa_enabled %}
7+
{% if is_2fa_enabled %}
8+
<a class="button serious button-longrunning" href="{% url 'users:admin_disable' user.pk %}">
9+
{% trans "Disable 2FA" %}
10+
</a>
11+
{% else %}
12+
<button type="button" title="{% trans "This account does not have 2FA enabled." %}" class="button" disabled>{% trans "2FA is disabled" %}</button>
13+
{% endif %}
14+
{% endblock %}
215

316
{% block extra_fields %}
417
<li>{% include "wagtailadmin/shared/field.html" with field=form.full_name %}</li>

0 commit comments

Comments
 (0)