#30162 closed Bug (duplicate)
Model error_message 'required' gets overridden by default_error_message
Reported by: | Oskar Haller | Owned by: | nobody |
---|---|---|---|
Component: | Forms | Version: | 2.1 |
Severity: | Normal | Keywords: | custom model error_messages overwritten |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
When creating a custom user model I tried the following.
error_messages={'required': _('Please enter your last name.')}
However, it get's overridden by the default_error_message "This field is required."
Unless I specify the 'required' error_message in my form.
This is related to this bug-report 5-years ago https://code.djangoproject.com/ticket/22105 . Is the behavior above still considered 'deliberate'. If so could you elaborate on it? I really see no explanation why this could be wanted.
Change History (3)
comment:1 by , 6 years ago
Description: | modified (diff) |
---|---|
Summary: | Model error_message 'required' gets overwritten by default_error_message → Model error_message 'required' gets overridden by default_error_message |
comment:2 by , 6 years ago
Component: | Uncategorized → Forms |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
comment:3 by , 6 years ago
Alright, thanks for the link to the documentation and clarification. I'll post the link under the old ticket as well.
It's documented:
Changing the behavior would be backwards incompatible. If you want to propose changing it, try putting together a patch and presenting a proposal on the DevelopersMailingList. That said, the rationale at ticket:22105#comment:1 makes sense to me so I'm not sure that a proposal has much chance of success.
I'd ask that you not create duplicate tickets (of #22105 in this case) and instead use DevelopersMailingList for design decision reconsiderations.