# Path: accounts/utils.py
# def user_without_team(user):
#     return user.profile.team is None


from rest_framework.permissions import BasePermission
from accounts.utils import user_without_team



class UserWithoutTeam(BasePermission):

    def has_permission(self, request, view):
        return user_without_team(request.user)


class UserWithoutTeamOrAdmin(BasePermission):

    def has_permission(self, request, view):

# Path: accounts/utils.py
# def user_without_team(user):
#     return user.profile.team is None


# Path: accounts/permissions.py
from rest_framework.permissions import BasePermission
from accounts.utils import user_without_team




class UserWithoutTeam(BasePermission):

    def has_permission(self, request, view):
        return user_without_team(request.user)


class UserWithoutTeamOrAdmin(BasePermission):

    def has_permission(self, request, view):

        return user_without_team(request.user) or request.user.is_superuser