Drop deprecated AutoSchema._get_reference method

As well the unused RemovedInDRF316Warning
This commit is contained in:
Bruno Alla 2024-09-10 14:12:51 +01:00
parent 61e33761eb
commit 10ea334096
No known key found for this signature in database
2 changed files with 1 additions and 15 deletions

View File

@ -23,9 +23,5 @@ HTTP_HEADER_ENCODING = 'iso-8859-1'
ISO_8601 = 'iso-8601'
class RemovedInDRF316Warning(DeprecationWarning):
pass
class RemovedInDRF317Warning(PendingDeprecationWarning):
pass

View File

@ -11,9 +11,7 @@ from django.core.validators import (
from django.db import models
from django.utils.encoding import force_str
from rest_framework import (
RemovedInDRF316Warning, exceptions, renderers, serializers
)
from rest_framework import exceptions, renderers, serializers
from rest_framework.compat import inflection, uritemplate
from rest_framework.fields import _UnvalidatedField, empty
from rest_framework.settings import api_settings
@ -721,11 +719,3 @@ class AutoSchema(ViewInspector):
path = path[1:]
return [path.split('/')[0].replace('_', '-')]
def _get_reference(self, serializer):
warnings.warn(
"Method `_get_reference()` has been renamed to `get_reference()`. "
"The old name will be removed in DRF v3.16.",
RemovedInDRF316Warning, stacklevel=2
)
return self.get_reference(serializer)