1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

reorg imports and black format

This commit is contained in:
catborise 2022-11-02 16:05:41 +03:00
parent fcd4b79431
commit a1eab70e2d
27 changed files with 319 additions and 305 deletions

View file

@ -30,9 +30,10 @@ def create_admin(sender, **kwargs):
"""
Create initial admin user
"""
from accounts.models import UserAttributes
from django.contrib.auth.models import User
from accounts.models import UserAttributes
plan = kwargs.get("plan", [])
for migration, rolled_back in plan:
if (

View file

@ -173,8 +173,7 @@ def email_otp(request):
send_email_with_otp(user, device)
messages.success(
request,
_("OTP Sent to %(email)s") % {"email": form.cleaned_data["email"]}
request, _("OTP Sent to %(email)s") % {"email": form.cleaned_data["email"]}
)
return redirect("accounts:login")
@ -195,12 +194,8 @@ def admin_email_otp(request, user_id):
if user.email != "":
send_email_with_otp(user, device)
messages.success(
request,
_("OTP QR code was emailed to user %(user)s") % {"user": user}
request, _("OTP QR code was emailed to user %(user)s") % {"user": user}
)
else:
messages.error(
request,
_("User email not set, failed to send QR code")
)
messages.error(request, _("User email not set, failed to send QR code"))
return redirect("accounts:account", user.id)