use exists

This commit is contained in:
wh1te909 2024-10-25 03:34:07 +00:00 committed by sadnub
parent 038304384a
commit 0d021a800a
1 changed files with 1 additions and 2 deletions

View File

@ -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()