#30162: Model error_message 'required' gets overridden by default_error_message
-------------------------------------+-------------------------------------
Reporter: Oskar Haller | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 2.1
Severity: Normal | Resolution:
Keywords: custom model | Triage Stage:
error_messages overwritten | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Oskar Haller:
Old description:
> When creating a custom user model I tried the following.
>
> error_messages={'required': _('Please enter your last name.')}
>
> However, it get's overwritten by the default_error_message "This field is
> required."
>
> Unless I specify the 'required' error_message in the 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.
New description:
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.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/30162#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/062.3226e9156beefd2a10ca315ef62aedcf%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.