def forbidden_words(cls, user_data): user = Authenticator.authenticate_team(user_data, TeamRoles.is_team_moderator) forbidden_words = TeamDatabaseClient.get_forbidden_words_from_team( user.team_id) cls.logger().info( f"User #{user.id} got {len(forbidden_words)} forbidden words in team #{user.team_id}." ) return SuccessfulForbiddenWordsList( cls._generate_forbidden_words_list(forbidden_words))
def __init__(self, team_id): self.forbidden_words = TeamDatabaseClient.get_forbidden_words_from_team(team_id)