def generate_password_reset_url(cls, user): # Make a one-time token linked to this user. token = ResetToken.for_user(user) return parse.urljoin( BASE_URL, f"/reset-password/complete/{user.portunus_uuid}/{token}/", )
def send_account_creation_notice(cls, user): token = ResetToken.for_user(user) new_account_url = parse.urljoin( BASE_URL, f"/set-password/{user.portunus_uuid}/{token}", ) cls.send_email( [user.email], "Account Created", "new_account", {"user": user, "new_account_url": new_account_url}, )
def send_password_reset(cls, user): # Make a one-time token linked to this user. token = ResetToken.for_user(user) reset_url = parse.urljoin( BASE_URL, f"/reset_password/complete/{user.portunus_uuid}/{token}/", ) cls.send_email( [user.email], "Password Reset Request", "reset_password", {"user": user, "reset_url": reset_url}, )