forked from encode/django-rest-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop calling
set_context
, planned for 3.13 drop (encode#8589)
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 we can safely delete it, in favor of `requires_context`. From the 3.11 announcement: > Previous our approach to this was that implementations could include a > `set_context` method, which would be called prior to validation. However > this approach had issues with potential race conditions. We have now > move this approach into a pending deprecation state. It will continue to > function, but will be escalated to a deprecated state in 3.12, and > removed entirely in 3.13. 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 to intercept `rest_framework.RemovedInDRF313Warning`, an error will be thrown due to an unresolvable reference).
- Loading branch information
Showing
2 changed files
with
2 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters