Opened 6 years ago

Last modified 6 years ago

#30162 closed Bug

Model error_message 'required' gets overridden by default_error_message — at Version 1

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 Oskar Haller)

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 (1)

comment:1 by Oskar Haller, 6 years ago

Description: modified (diff)
Summary: Model error_message 'required' gets overwritten by default_error_messageModel error_message 'required' gets overridden by default_error_message
Note: See TracTickets for help on using tickets.
Back to Top