You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
373 B

  1. from django.contrib.auth.tokens import PasswordResetTokenGenerator
  2. from django.utils import six
  3. class TokenGenerator(PasswordResetTokenGenerator):
  4. def _make_hash_value(self, user, timestamp):
  5. return (
  6. six.text_type(user.pk) + six.text_type(timestamp) +
  7. six.text_type(user.is_active)
  8. )
  9. account_activation_token = TokenGenerator()