Skip to content
Snippets Groups Projects
Commit c3757f5f authored by James Graham's avatar James Graham
Browse files

Re-enable functionality to start new user accounts as disabled

parent 96206136
No related branches found
No related tags found
No related merge requests found
......@@ -231,8 +231,8 @@ SOCIAL_AUTH_PIPELINE = [
# 'social_core.pipeline.social_auth.associate_by_email',
# Create a user account if we haven't found one yet.
'social_core.pipeline.user.create_user',
# 'profiles.social_auth.create_user_disabled',
# 'social_core.pipeline.user.create_user',
'profiles.social_auth.create_user_disabled',
# Create the record that associates the social account with the user.
'social_core.pipeline.social_auth.associate_user',
......
"""
Module containing customisations to the Python Social Auth pipeline.
See https://python-social-auth.readthedocs.io/en/latest/
"""
from social_core.pipeline.user import create_user
def create_user_disabled(strategy, details, backend, user=None, *args, **kwargs):
"""
Create a user account for the user being authenticated - but mark it as disabled.
A new user must have their account enabled by an admin before they are able to log in.
"""
# Returns dict containing 'is_new' and 'user'
result = create_user(strategy, details, backend, user, *args, **kwargs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment