3

I haven't been able to find how to do this simple thing:

I have two different type of users in my website, type A users registered with Facebook and type B users logged in with a regular user register form. ¿How can I find out if a user belongs to group A? (Outside of the pipeline, of course). I need to import the Python Social Auth models and perform an .exists() query or something like that ... but what is the name of that model? where do I import it from?

Alejandro Veintimilla
  • 10,743
  • 23
  • 91
  • 180

1 Answers1

2

Solution:

from social.apps.django_app.default.models import UserSocialAuth

if UserSocialAuth.objects.filter(user=request.user).exists():
    ....
Alejandro Veintimilla
  • 10,743
  • 23
  • 91
  • 180