Stop calling set_context
, planned for 3.13 drop
#8589
Merged
+2
−34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Per the deprecation warnings (which have been raised since DRF 3.11),
set_context()
was planned not to be supported in DRF 3.13. I think wecan safely delete it, in favor of
requires_context
.Since this represents an API change, maybe it's best slated for 3.14?
(We could alternatively start raising
RemovedInDRF314Warning
)From the 3.11 announcement:
Why keep
RemovedInDRF313Warning
around?It's a bit odd that version 3.13 includes an exception class describing
things which are to be deleted in 3.13, but I've opted to keep the (now
unreferenced) class around, for fear of breaking others' setup.
(For example, if projects have a
filterwarnings
setup meant tointercept
rest_framework.RemovedInDRF313Warning
, an error will bethrown due to an unresolvable reference).