#2807 closed defect (wontfix)
allow overriding default "This field is required." text
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Validators | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hi,
If you create a cutom form, you can specify the isRequired property. If it is set to True and the field is not submitted, the error raised will be a (very) generic "This field is required.".
It would be useful if you could override the return validationerror somehow.
One possibility is the make isRequired a 'ready-made' validator rather than a property since all ready-made validators have an error_message that can be passed in if validation fails.
It would also remove the special-case handling of 'isRequired' and make it just another validator. Being generic can be good - especially if you get to throw in a feature for free :-)
Not worth fixing this one.