Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Stop calling set_context, planned for 3.13 drop #8589

Merged
merged 1 commit into from
Aug 8, 2022

Commits on Aug 4, 2022

  1. Stop calling set_context, planned for 3.13 drop

    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).
    DavidCain committed Aug 4, 2022
    Configuration menu
    Copy the full SHA
    7b0e362 View commit details
    Browse the repository at this point in the history