4π
β
The pipeline expects to follow the order in which functions needs to be called.
To my solution right sequence should be like:
SOCIAL_AUTH_PIPELINE = [ # Note: Sequence of functions matters here.
'social.pipeline.social_auth.social_details', # 0
'social.pipeline.social_auth.social_uid', # 1
'social.pipeline.social_auth.auth_allowed', # 2
'social.pipeline.social_auth.social_user', # 3
'social.pipeline.user.get_username', # 4
'social.pipeline.social_auth.associate_by_email', # 5
'social.pipeline.social_auth.associate_user', # 6
'social.pipeline.social_auth.load_extra_data', # 7
'social.pipeline.user.user_details', # 8
]
# Adding conditional functions to pipepline.
# NOTE: Sequence of functions matters here.
if config.GCPAuthentication.AUTO_CREATE_ACCOUNTS:
SOCIAL_AUTH_PIPELINE.insert(6, 'social.pipeline.user.create_user')
π€Nitin Verma
1π
Yes you are right, Sequence of the function in the pipeline matters here as return of one function will be input to the next function in pipeline.
π€gcpexpert
0π
As a sidenote I want to add that I faced a similar issue when I updated my USER
model by changing itβs primary key. In such scenarios, simply running migrations for the new USER
model will not suffice. You will have to run migrations for the social auth as well. I did it by complete & forced migration of the entire project.
π€rahulthakur319
- [Django]-Django template How to Convert numbers to Words
- [Django]-Django Registration Redux: how to change the unique identifier from username to email and use email as login
- [Django]-How do I prevent Django from interpreting a block which contains curly quotes?
0π
I had the same error coming from a corrupted local DB. I had to cleanup the tables: social_auth_usersocialauth
and django_session
.
π€obotezat
- [Django]-Django mysql error
- [Django]-Django-Tagging β count and ordering top "tags" (Is there a cleaner solution to mine?)
- [Django]-Django-orm : How to update one-to-one relation field value
- [Django]-Django Writable Nested Serializers Update
- [Django]-Django: how to get the current user's group id
Source:stackexchange.com