expephalon/core/helpers/auth.py

11 lines
No EOL
453 B
Python

from core.helpers.mail import get_template
from core.helpers.urls import relative_to_absolute as reltoabs
from django.urls import reverse
from dbsettings.functions import getValue
def generate_pwreset_mail(user, token):
link = reltoabs(reverse("pwreset", kwargs={"pk": str(token.token)}))
template = get_template("backend/auth/pwreset", first_name=user.first_name, link=link, sitename=getValue("core.title", "Expephalon"))
return template