Closes #14
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
$("#modal-footer").prepend("<button id='actionBtn' class='btn btn-danger' onclick='confirmDel("+id+")'>Confirm Deletion</button>")
|
$("#modal-footer").prepend("<button id='actionBtn' class='btn btn-danger' onclick='confirmDel("+id+")'>Confirm Deletion</button>")
|
||||||
$("#popUpModal").modal()
|
$("#popUpModal").modal()
|
||||||
}
|
}
|
||||||
{% if not HIDE_DISABLE %}
|
|
||||||
function toggleKey(id) {
|
function toggleKey(id) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url:"{% url 'toggle_key' %}?id="+id,
|
url:"{% url 'toggle_key' %}?id="+id,
|
||||||
@@ -34,7 +34,6 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
{% endif %}
|
|
||||||
</script>
|
</script>
|
||||||
<link href="{% static 'mfa/css/bootstrap-toggle.min.css' %}" rel="stylesheet">
|
<link href="{% static 'mfa/css/bootstrap-toggle.min.css' %}" rel="stylesheet">
|
||||||
<script src="{% static 'mfa/js/bootstrap-toggle.min.js'%}"></script>
|
<script src="{% static 'mfa/js/bootstrap-toggle.min.js'%}"></script>
|
||||||
|
|||||||
@@ -77,9 +77,12 @@ def toggleKey(request):
|
|||||||
q=User_Keys.objects.filter(username=request.user.username, id=id)
|
q=User_Keys.objects.filter(username=request.user.username, id=id)
|
||||||
if q.count()==1:
|
if q.count()==1:
|
||||||
key=q[0]
|
key=q[0]
|
||||||
key.enabled=not key.enabled
|
if not key.key_type in settings.MFA_HIDE_DISABLE:
|
||||||
key.save()
|
key.enabled=not key.enabled
|
||||||
return HttpResponse("OK")
|
key.save()
|
||||||
|
return HttpResponse("OK")
|
||||||
|
else:
|
||||||
|
return HttpResponse("You can't change this method.")
|
||||||
else:
|
else:
|
||||||
return HttpResponse("Error")
|
return HttpResponse("Error")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user