use exists
This commit is contained in:
parent
038304384a
commit
0d021a800a
|
@ -10,5 +10,4 @@ from allauth.socialaccount.models import SocialAccount
|
|||
|
||||
class SSOLoginPerms(permissions.BasePermission):
|
||||
def has_permission(self, r, view):
|
||||
connected_apps = SocialAccount.objects.filter(user=r.user)
|
||||
return len(connected_apps) > 0
|
||||
return SocialAccount.objects.filter(user=r.user).exists()
|
||||
|
|
Loading…
Reference in New Issue