Commit 686bedaa authored by Bruno Martin's avatar Bruno Martin

organize django all auth variables, add logout on getfor compatibility

parent 336de7a7
......@@ -303,13 +303,22 @@ REST_AUTH_REGISTER_SERIALIZERS = {
'REGISTER_SERIALIZER': 'users.serializers.RegistrationSerializer'
}
# django-all-auth configs
# ------------------------------
AUTH_USER_MODEL = 'users.User'
# Some really nice defaults
ACCOUNT_AUTHENTICATION_METHOD = 'email'
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_EMAIL_VERIFICATION = 'optional'
ACCOUNT_USERNAME_REQUIRED = False
LOGIN_URL = env.str('DJANGO_LOGIN_URL', 'account_login')
LOGIN_REDIRECT_URL = env.str('DJANGO_LOGIN_REDIRECT_URL', 'courses_legacy:dashboard')
ACCOUNT_ALLOW_REGISTRATION = env.bool('DJANGO_ACCOUNT_ALLOW_REGISTRATION', True)
SOCIALACCOUNT_ADAPTER = 'users.adapters.SocialAccountAdapter'
SOCIALACCOUNT_QUERY_EMAIL = True
......@@ -338,11 +347,6 @@ SOCIALACCOUNT_PROVIDERS = {
}
}
# Custom user app defaults
# Select the correct user model
AUTH_USER_MODEL = 'users.User'
LOGIN_URL = 'account_login'
# SLUGLIFIER
AUTOSLUG_SLUGIFY_FUNCTION = 'slugify.slugify'
......@@ -419,3 +423,8 @@ SITE_NAME = env.str('DJANGO_SITE_NAME', default='Site Name')
THEMES_DIR = ''
TIMTEC_THEME = env.str('DJANGO_TIMTEC_THEME', default='courses_legacy')
TIMTEC_THEMES_COMPAT = env.bool('DJANGO_TIMTEC_THEMES_COMPAT', default=False)
if TIMTEC_THEMES_COMPAT:
# FIXME remove this ACCOUNT_LOGOUT_ON_GET, see more here:
# https://django-allauth.readthedocs.io/en/latest/views.html?highlight=login%20redirect#logout-account-logout
ACCOUNT_LOGOUT_ON_GET = True
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment