mirror of
https://github.com/TrentSPalmer/trentpalmerdotorg.git
synced 2024-12-21 20:42:49 -08:00
update enable_totp(request) redirect if totp is already enabled
This commit is contained in:
parent
5b99609dc7
commit
e65a1026f8
@ -26,6 +26,8 @@ def disable_totp(request):
|
||||
def enable_totp(request):
|
||||
if not request.user.is_authenticated:
|
||||
return redirect('audio:home')
|
||||
if request.user.account.use_totp and request.user.account.totp_key is not None:
|
||||
return(redirect('accounts:edit_profile'))
|
||||
qr = get_totp_qr(request.user)
|
||||
if request.method == "POST":
|
||||
form = EnableTotpForm(request.POST, instance=request.user.account)
|
||||
|
Loading…
Reference in New Issue
Block a user