rename model to UserKey

This commit is contained in:
Tobias Bengfort
2021-06-17 11:02:20 +02:00
parent ba4e7f9a17
commit 68e257d60e
9 changed files with 52 additions and 35 deletions

View File

@@ -12,7 +12,7 @@ from django.utils import timezone
from django.views.decorators.cache import never_cache
from .Common import send
from .models import User_Keys
from .models import UserKey
from .views import login
@@ -36,7 +36,7 @@ def start(request):
context = csrf(request)
if request.method == "POST":
if request.session["email_secret"] == request.POST["otp"]: # if successful
uk = User_Keys()
uk = UserKey()
uk.username = request.user.username
uk.key_type = "Email"
uk.enabled = 1
@@ -62,7 +62,7 @@ def auth(request):
context = csrf(request)
if request.method == "POST":
if request.session["email_secret"] == request.POST["otp"].strip():
uk = User_Keys.objects.get(
uk = UserKey.objects.get(
username=request.session["base_username"], key_type="Email"
)
mfa = {"verified": True, "method": "Email", "id": uk.id}