make remove button conditional

This commit is contained in:
Matthias 2021-11-01 22:45:56 +01:00
parent 392e7f6e4c
commit fc0e80dd76
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -196,7 +196,9 @@
<div class="col-md-6"> <div class="col-md-6">
<h5>{% trans "Change faktors" %}</h5> <h5>{% trans "Change faktors" %}</h5>
<a href="{% url 'two-factor-setup' %}" class="btn btn-primary" {% if user.staticdevice_set.all and user.totpdevice_set.all %}disabled{% endif %}>{% trans "Setup multifaktor" %}</a> <a href="{% url 'two-factor-setup' %}" class="btn btn-primary" {% if user.staticdevice_set.all and user.totpdevice_set.all %}disabled{% endif %}>{% trans "Setup multifaktor" %}</a>
{% if user.staticdevice_set.all or user.totpdevice_set.all %}
<a href="{% url 'two-factor-remove' %}" class="btn btn-primary">{% trans "Remove multifaktor" %}</a> <a href="{% url 'two-factor-remove' %}" class="btn btn-primary">{% trans "Remove multifaktor" %}</a>
{% endif %}
</div> </div>
</div> </div>