diff --git a/hypha/apply/users/templates/wagtailusers/users/edit.html b/hypha/apply/users/templates/wagtailusers/users/edit.html index 6de2d3c9c4d17c60727cf4aaef6f8c11a9ca726b..4dc2465796b6b4c912b82181416e2f51040a5c67 100644 --- a/hypha/apply/users/templates/wagtailusers/users/edit.html +++ b/hypha/apply/users/templates/wagtailusers/users/edit.html @@ -50,7 +50,11 @@ {% endif %} <!-- Add a custom button to user account edit form --> {% user_2fa_enabled as is_2fa_enabled %} - <a href="{% if is_2fa_enabled %}{% url 'users:two_factor_reset' user.pk %}{% else %}javascript:void(0){% endif %}" class="button {% if not is_2fa_enabled %}disabled{% endif %}" {% if not is_2fa_enabled %} title="{% blocktranslate %} {{ user }}'s 2FA security has been disabled {% endblocktranslate %}" {% endif %}>{% trans "Disable 2FA" %}</a> + {% if is_2fa_enabled %} + <a href="{% url 'users:two_factor_reset' user.pk %}" class="button">{% trans "Disable 2FA" %}</a> + {% else %} + <button type="button" title="{% trans "This account do not have 2FA enabled." %}" class="button" disabled>{% trans "Disable 2FA" %}</button> + {% endif %} </li> </ul> </section>