Custom validation method #9464
Unanswered
mhdemd
asked this question in
Question & Answer
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
When using a custom validation method
validate_price
in a serializer to enforce specific validation rules for aDecimalField
, the default validation messages from Django are shown instead of the custom validation messages provided in the method.To Reproduce
Steps to reproduce the behavior:
DecimalField
and a custom validation method for this field.Expected behavior
The custom validation messages defined in the
validate_price
method should be shown when the validation fails.Code Snippet
Beta Was this translation helpful? Give feedback.
All reactions