Repository navigation
Drop set_context() - #7062
Merged
Merged
Drop set_context()#7062
set_context()#7062Conversation
carltongibson
left a comment
Collaborator
There was a problem hiding this comment.
Of the two options you mentioned in #6172 (comment), I much prefer this. (To inspecting __call__())
Looks neat at first glance. Would need calling out in the release notes, but should be simple enough to inline existing set_context() implementations.
Member
Author
|
Sure, also it is still our regular gentle deprecation process, so not a big deal. |
Contributor
|
My brain is currently toast, but I'll try to look at this over the weekend. |
bd808
added a commit
to bd808/drf-friendly-errors
that referenced
this pull request
Nov 14, 2020
In encode/django-rest-framework#7062 the API for calling DRF validators changed to require the caller to inspect the validator instance to determine if the validator requires a second argument at call time. Usage with DRF >=3.11.0 requires this support.
bd808
added a commit
to bd808/drf-friendly-errors
that referenced
this pull request
Nov 14, 2020
In encode/django-rest-framework#7062 the API for calling DRF validators changed to require the caller to inspect the validator instance to determine if the validator requires a second argument at call time. Usage with DRF >=3.11.0 requires this support.
pchiquet
pushed a commit
to pchiquet/django-rest-framework
that referenced
this pull request
Nov 17, 2020
* Do not persist the context in validators Fixes encode#5760 * Drop set_context() in favour of 'requires_context = True'
sigvef
pushed a commit
to sigvef/django-rest-framework
that referenced
this pull request
Dec 3, 2022
* Do not persist the context in validators Fixes encode#5760 * Drop set_context() in favour of 'requires_context = True'
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow on from #6172
Drops
set_context()on defaults and validators, in favour of arequires_context = Truemarker, which causes the serializer field to be passed as an additional argument.What do we think about this?