1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-21 07:18:22 +02:00

Fully test registration app

This commit is contained in:
Yohann D'ANELLO
2020-09-24 14:15:42 +02:00
parent cedb693c5b
commit 1979d33314
6 changed files with 143 additions and 9 deletions

View File

@ -60,6 +60,7 @@ INSTALLED_APPS = [
'rest_framework',
'rest_framework.authtoken',
'api',
'eastereggs',
'registration',
'participation',

View File

@ -20,7 +20,8 @@ class AccountActivationTokenGenerator(PasswordResetTokenGenerator):
# Truncate microseconds so that tokens are consistent even if the
# database doesn't support microseconds.
login_timestamp = '' if user.last_login is None else user.last_login.replace(microsecond=0, tzinfo=None)
return str(user.pk) + str(user.email) + str(login_timestamp) + str(timestamp)
return str(user.pk) + str(user.email) + str(user.registration.email_confirmed)\
+ str(login_timestamp) + str(timestamp)
email_validation_token = AccountActivationTokenGenerator()