Allowing Session email address

This commit is contained in:
Mohamed ElKalioby
2019-03-11 13:07:05 +03:00
parent ce6a224818
commit c693007d62
2 changed files with 7 additions and 2 deletions

View File

@@ -106,7 +106,12 @@ def start(request):
def send_email(request):
body=render(request,"TrustedDevices/email.html",{}).content
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"
else:
res="Error occured, please try again later."

View File

@@ -4,7 +4,7 @@ from setuptools import find_packages, setup
setup(
name='django-mfa2',
version='1.0.4',
version='1.0.5',
description='Allows user to add 2FA to their accounts',
long_description=open("README.md").read(),
long_description_content_type="text/markdown",