diff --git a/mfa/Email.py b/mfa/Email.py index 37ccdc8..a2c3119 100644 --- a/mfa/Email.py +++ b/mfa/Email.py @@ -14,9 +14,7 @@ def sendEmail(request,username,secret): kwargs = {key: username} user = User.objects.get(**kwargs) res=render(request,"mfa_email_token_template.html",{"request":request,"user":user,'otp':secret}) - body = str(res.content).replace("b'", "") - body = body[:-1] if body.endswith("'") else body - return send([user.email],"OTP", body) + return send([user.email],"OTP", res.content.decode()) @never_cache def start(request):