Use decode method to decode the byte string instead of casting it to string and replacing the byte string syntax in the string.
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user