[Answer]-Disable user registration with django-social-auth

1👍

You can make that possible by overriding the pipeline setting with one that drops create_user entry (there’s an example in the pipeline docs at http://python-social-auth-docs.readthedocs.io/en/latest/pipeline.html). Basically define this setting:

SOCIAL_AUTH_PIPELINE = (
    'social_auth.backends.pipeline.social.social_auth_user',
    'social_auth.backends.pipeline.social.associate_user',
    'social_auth.backends.pipeline.social.load_extra_data',
    'social_auth.backends.pipeline.user.update_user_details'
)

Also you could add your own entry that does the check for you, like this:

def user_must_exists(user=None, *args, **kwargs):
    if user is None:
        raise YourExceptionHere()
👤omab

Leave a comment