0

As the title indicates, I would like to know how to do to distinguish a user that is logged in with facebook from a user that is logged in by mail. I'm using django-facebook.

It seems that

 request.user.is_authenticated()

is for every kind of authentification.

Any help would be welcome,

JojoL
  • 141
  • 1
  • 8

1 Answers1

1

I think you can check if request.user has a FacebookProfile:

{% if request.user.facebookprofile %}user has facebook profile{% endif %}

Or in python:

if request.user.facebookprofile_id:
    print 'has facebookprofile'
jpic
  • 32,891
  • 5
  • 112
  • 113
  • thank you, I tried but I get this error : 'User' object has no attribute 'facebookprofile_id' – JojoL Oct 24 '12 at 13:09
  • Ok, I found the solution. I had to add the name of my custom user profile: request.user.userprofile.facebook_id. Thank you for your help. – JojoL Oct 24 '12 at 13:35