user is saved but get integrityError anyway
Closed this issue · 4 comments
When i first login with a new user using the fandjango setup i always get the following error:
Exception Type: IntegrityError at /
Exception Value: (1048, "Column 'facebook_id' cannot be null")
The user is saved, including the facebook_id, so i'm not sure where the actual problem is...
Ok never mind. I was trying to create a profile with some extra fields using a post_save signal and that was causing the error. Closing this...
That's strange.
The exception suggests that it's trying to save a user whose Facebook profile doesn't list an id (see lines 77 through 97 in middleware.py), though I've never encountered a profile that doesn't.
Would you mind sharing the user's username and/or id (since it was registered after all)?
EDIT: Ah, nevermind. ;-)
This happens when Facebook's API is not responding the correct way, see http://dpaste.com/661988/ for example.
Facebook returns an error like "Error validating access token: Cannot obtain session information due to a system error." and the whole request fails.
EDIT: The token inside the dpaste post was valid, but I changed it so nobody can use it, because now its public.
This is "fixed" in the next major version, which uses Facepy to communicate with Facebook and will raise GraphAPI.Error
rather than IntegrityError
.