If you're logged into the Django site and hit the Facebook connect button, the facebook_connect view (which is the callback post-FB authentication) does not distinguish between having a pre-existing FacebookProfile object for the current user, and having one for a different user. We're doing the following to separate that out into a separate failure case:
def facebook_connect(request, template='socialregistration/facebook.html',
View to handle connecting existing django accounts with facebook
if request.facebook.uid is None or request.user.is_authenticated() is False:
return render_to_response(template, extra_context,
profile = FacebookProfile.objects.get(uid=request.facebook.uid)
# this means that the profile already exists; is it connected to this user?
if profile.user != request.user:
extra_context.update(dict(error=_("That Facebook profile is already connected to another user")))
return render_to_response(prelinked_template, extra_context,
profile = FacebookProfile.objects.create(user=request.user,
Otherwise, you'll keep on seeing the "connect via Facebook" button, and it'll keep on doing nothing, if you've already linked that Facebook user to another Django user.
Fixed: #143 #142 #127 #79