Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix #3844, refine validator for fields with <source=> kwargs #4146

Merged
merged 1 commit into from May 26, 2016
Merged

Fix #3844, refine validator for fields with <source=> kwargs #4146

merged 1 commit into from May 26, 2016

Conversation

xiaohanyu
Copy link
Contributor

@xiaohanyu xiaohanyu commented May 26, 2016

Description

This PR fix a bug in UniqueValidator when applied to related model fields. As discussed in #3844 , I first made a proposal, with a demo code and no test, and it got rejected. Two days ago, somebody reported the same error as I met, so I think I should spent a little more time on this and add a regression testcase for this bug fix.

When serializers has fields with something like source=user.email, the
uniqueness validator should check email field instead of user, cause
user is a model object.

When serializers has fields with something like `source=user.email`, the
uniqueness validator should check `email` field instead of `user`, cause
`user` is a model object.
@xordoquy xordoquy added this to the 3.3.4 Release milestone May 26, 2016
@xordoquy xordoquy merged commit 2d20f09 into encode:master May 26, 2016
2 checks passed
@xordoquy
Copy link
Collaborator

xordoquy commented May 26, 2016

Thanks for all the work @xiaohanyu !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants