Allowing Session email address
This commit is contained in:
@@ -106,7 +106,12 @@ def start(request):
|
|||||||
def send_email(request):
|
def send_email(request):
|
||||||
body=render(request,"TrustedDevices/email.html",{}).content
|
body=render(request,"TrustedDevices/email.html",{}).content
|
||||||
from .Common import send
|
from .Common import send
|
||||||
if send([request.user.email],"Add Trusted Device Link",body):
|
e=request.user.email
|
||||||
|
if e=="":
|
||||||
|
e=request.session.get("user",{}).get("email","")
|
||||||
|
if e=="":
|
||||||
|
res = "User has no email on the system."
|
||||||
|
elif send([e],"Add Trusted Device Link",body):
|
||||||
res="Sent Successfully"
|
res="Sent Successfully"
|
||||||
else:
|
else:
|
||||||
res="Error occured, please try again later."
|
res="Error occured, please try again later."
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -4,7 +4,7 @@ from setuptools import find_packages, setup
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='django-mfa2',
|
name='django-mfa2',
|
||||||
version='1.0.4',
|
version='1.0.5',
|
||||||
description='Allows user to add 2FA to their accounts',
|
description='Allows user to add 2FA to their accounts',
|
||||||
long_description=open("README.md").read(),
|
long_description=open("README.md").read(),
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
|||||||
Reference in New Issue
Block a user