Created
May 9, 2020 14:52
-
-
Save LouisdeBruijn/a6c020dfd4bdeabcceb59237667d3d70 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.contrib.auth.tokens import PasswordResetTokenGenerator | |
| from django.utils import six | |
| class AccountActivationTokenGenerator(PasswordResetTokenGenerator): | |
| def _make_hash_value(self, user, timestamp): | |
| return ( | |
| six.text_type(user.pk) + six.text_type(timestamp) + | |
| six.text_type(user.profile.email_confirmed) | |
| ) | |
| class PasswordResetToken(PasswordResetTokenGenerator): | |
| def _make_hash_value(self, user, timestamp): | |
| return ( | |
| six.text_type(user.pk) + six.text_type(timestamp) + | |
| six.text_type(user.profile.reset_password) | |
| ) | |
| account_activation_token = AccountActivationTokenGenerator() | |
| password_reset_token = PasswordResetToken() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment