From 619485f61b98cea51944a7411262eab194066fed Mon Sep 17 00:00:00 2001 From: Tim Schilling Date: Wed, 7 Sep 2022 09:56:48 -0500 Subject: [PATCH] Change openapi _get_reference removal to 3.15 This deprecation was never released in the 3.13.x series and therefore can't be removed at the same time the replacement is released. --- rest_framework/__init__.py | 4 ++++ rest_framework/schemas/openapi.py | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/rest_framework/__init__.py b/rest_framework/__init__.py index d812e657c..568e08074 100644 --- a/rest_framework/__init__.py +++ b/rest_framework/__init__.py @@ -35,3 +35,7 @@ class RemovedInDRF313Warning(DeprecationWarning): class RemovedInDRF314Warning(PendingDeprecationWarning): pass + + +class RemovedInDRF315Warning(PendingDeprecationWarning): + pass diff --git a/rest_framework/schemas/openapi.py b/rest_framework/schemas/openapi.py index 122846376..c0b51e406 100644 --- a/rest_framework/schemas/openapi.py +++ b/rest_framework/schemas/openapi.py @@ -13,7 +13,8 @@ from django.db import models from django.utils.encoding import force_str from rest_framework import ( - RemovedInDRF314Warning, exceptions, renderers, serializers + RemovedInDRF314Warning, RemovedInDRF315Warning, exceptions, renderers, + serializers ) from rest_framework.compat import uritemplate from rest_framework.fields import _UnvalidatedField, empty @@ -812,7 +813,7 @@ class AutoSchema(ViewInspector): 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.14.", - RemovedInDRF314Warning, stacklevel=2 + "The old name will be removed in DRF v3.15.", + RemovedInDRF315Warning, stacklevel=2 ) return self.get_reference(serializer)