Skip to content

Commit

Permalink
Modify syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
nnsnodnb committed Dec 29, 2023
1 parent 0e73f77 commit 1d5d285
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions passkeys/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@

from .models import UserPasskey


@login_required
def index(request,enroll=False): # noqa
keys = UserPasskey.objects.filter(user=request.user) # pragma: no cover
return render(request,'PassKeys.html',{"keys":keys,"enroll":enroll}) # pragma: no cover
def index(request, enroll=False): # noqa
keys = UserPasskey.objects.filter(user=request.user) # pragma: no cover
return render(request, 'PassKeys.html', {"keys": keys, "enroll": enroll}) # pragma: no cover


@login_required
def delKey(request):
key=UserPasskey.objects.get(id=request.GET["id"])
if key.user.pk == request.user.pk:
if key.user.pk == request.user.pk:
key.delete()
return HttpResponse("Deleted Successfully")
return HttpResponse("Error: You own this token so you can't delete it", status=403)


@login_required
def toggleKey(request):
id=request.GET["id"]
Expand Down

0 comments on commit 1d5d285

Please sign in to comment.