def authorize(self, request, *args, **kwargs):
        """
        authorization logic
        raises PermissionDenied if user is not authorized
        """
        user = request.user
        if not user.is_authenticated or not user.socialaccount_set.exists():
            raise PermissionDenied()
def authorize ( self , request , * args , ** kwargs ) : user = request . user if not user . is_authenticated or not user . socialaccount_set . exists ( ) : raise PermissionDenied ( )
authorization logic
        raises PermissionDenied if user is not authorized