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

Fixed #19671 -- M2M 'validators' run when form's full_clean() is called. #2897

Closed
wants to merge 1 commit into from

Conversation

coder9042
Copy link
Contributor

Have a look at my comments on the ticket: https://code.djangoproject.com/ticket/19671 for why I think this should be done and also about docs update

f.clean(self.cleaned_data[f.name], self.instance)
except ValidationError as e:
e.error_dict = {f.name: e}
self._update_errors(e)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't monkey-patch the exception, make a new one:
self._update_errors(ValidationError({f.name: e}))

@coder9042
Copy link
Contributor Author

Closing this based on discussion with @loic on IRC.
See ticket for details.

@coder9042 coder9042 closed this Jul 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants