Remove assertions for redundant SerializerMethodField source args. #2422
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.
As discussed in #2420, removed SerializerMethodField's assertion raised when redundant source params are passed.
It looks like this was also in the base Field class. For the sake of consistency, I removed this, too. While I think an error could make sense for something like a CharField on a ModelSerializer, it would be a bit of an inconsistent bit of policing. It's probably best left to the people using DRF to police their own codebases. FWIW, I'd definitely pick on redundant CharFields in my code reviews, but SerializerMethodFields are a lot more open-ended by definition.
If you wanted to take the split approach (policing for non-SerializerMethodField), I could add an optional kwarg to bind and have SerializerMethodField's init pass along a value to disable the policing. Though, that could gunk some people up since we'd be changing the signature of a pretty base level class.
The 3.0 release announcement were updated. I thought about adding an entry to the changelog under 3.0.4, but since I don't see a header for 3.0.4 yet I am assuming this is done as part of the release process.
All tests passed on tox, aside from the django-master stuff that was already failing beforehand.