Пример #1
0
 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}/",
     )
Пример #2
0
 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},
     )
Пример #3
0
 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},
     )