AttributeError at /complete/google-oauth2/
'NoneType' object has no attribute 'provider'
This happens with a new or already registered user at this line https://github.com/omab/python-social-auth/blob/master/social/actions.py#L69 and is a new problem. It appeared when I was playing around with a custom pipeline but it worked before, now reverting to the most basic python-social-auth set up doesn't work.
Even with a reloaded database and a refreshed syncdb. (This is Django 1.4.20, an old project we're upgrading).
The problem is clear, wherever in the default pipeline the social-user is meant to be set on user is not working, but I don't understand the python-social-auth code well enough and am going around in circles here. Any pointers or help would be much appreciated here.
The 500 that appears in my stack trace in case it's any help.
[23/Jul/2015 12:00:32] "GET /complete/google-oauth2/?state=MRFnOQG6Cv5Cmb1xqdcp53C33dDrFf7C&code=4/2bgjgYgxFtqB2c10BInigkigGfy4ZNOSYBqyHBUdLGo&authuser=0&prompt=consent&session_state=4c6c24bdd3100a506c4744be8ab9b793ed6399d5..a5f9 HTTP/1.1" 500 148571
This is the data that the code chokes on, it's obviously because some previous part of the pipeline doesn't put the "social_user" into user. But I don't know where it would be failing to do that, does someone more familiar with this have any suggestions where the default pipeline might fail?
partial None
is_authenticated False
args ()
is_new False
redirect_value ''
user <User: 4o5bb5o5>
social_user None
kwargs {}
login <function _do_login at 0xaef3de9c>
backend <social.backends.google.GoogleOAuth2 object at 0x9e68fac>
data <QueryDict: {u'state': [u'dwMOHkBxsVgvj4mwL54LXqihzJVYMWTV'], u'code': [u'4/fjOVlVyAK5mS_mcv7uHVWQsFycpjlbB_YOy4F7omIIY'], u'prompt': [u'none'], u'session_state': [u'ab65081ee8e4a3720d5963deced4cabc7b259a85..8f10'], u'authuser': [u'0']}>
redirect_name
'next'
When I then navigate to the home page I'm logged in fine with the gmail account. (Although some of the post_save functions that are meant to happen after create_user don't trigger, but I assume that's cos it crashed in the middle of the pipeline). Then when I log out and back in again it crashes again on the same page.