Conversion_Kitchen_Code/kitchen_counter/users/tokens.py

17 lines
719 B
Python
Raw Permalink Normal View History

2024-04-27 09:33:09 +00:00
from django.contrib.auth.tokens import PasswordResetTokenGenerator
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.is_active)
# )
#account_activation_token = AccountActivationTokenGenerator()
class TokenGenerator(PasswordResetTokenGenerator):
def _make_hash_value(self, user, timestamp):
return (
six.text_type(user.pk) + six.text_type(timestamp) +
six.text_type(user.is_active)
)
account_activation_token = TokenGenerator()