10 lines
376 B
Python
Executable File
10 lines
376 B
Python
Executable File
from django.contrib.auth.tokens import PasswordResetTokenGenerator
|
|
from six import text_type
|
|
|
|
class TokenGenerator(PasswordResetTokenGenerator):
|
|
def _make_hash_value(self, user, timestamp):
|
|
return (
|
|
text_type(user.pk) + text_type(timestamp) +
|
|
text_type(getattr(user, 'is_active', True))
|
|
)
|
|
account_activation_token = TokenGenerator() |