flashingpumpkin/django-socialregistration — pull request #142 by wesc (2012-02-17 23:16:12+00:00)
Title: Fix for bug that connects multiple profiles to users in some instances.

Here's the situation:

1. I log into Facebook as Alice
2. I log into the Django app using Facebook
3. I log out of Facebook
4. I log into Facebook as Bob
5. The app exposes a "connect with facebook" button, even though I'm logged in as Alice. I click on it.

The result: both Alice and Bob's Facebook profiles are linked with Alice's account in the app.

What this patch does is check to see if request.user does not match the user associated with the profile. If this is the case, log in as the user associated with the profile, rather than connect the profile with request.user.