def belongs_to_team(user, team):
    """Check if a user belong to the team.

    Parameters :
    user (UserProfile) : the user to check
    team (Team) : the team to check

    Return :
    boolean : True if the user belongs to team, else False
    """
    return user.groups.filter(id=team.id).exists()