From 5435b2c9f0ea58196236a1609e915cc1ed130ba4 Mon Sep 17 00:00:00 2001 From: "T. Franzel" Date: Mon, 28 Nov 2022 04:11:10 +0100 Subject: [PATCH] mitigate global dependency on inflection #8017 (#8781) --- rest_framework/schemas/openapi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rest_framework/schemas/openapi.py b/rest_framework/schemas/openapi.py index 8e0f400caa..840f6977ec 100644 --- a/rest_framework/schemas/openapi.py +++ b/rest_framework/schemas/openapi.py @@ -11,7 +11,6 @@ ) from django.db import models from django.utils.encoding import force_str -from inflection import pluralize from rest_framework import ( RemovedInDRF315Warning, exceptions, renderers, serializers @@ -249,6 +248,8 @@ def get_operation_id_base(self, path, method, action): name = name[:-len(action)] if action == 'list': + from inflection import pluralize + name = pluralize(name) return name