Opened 8 years ago

Closed 8 years ago

#27957 closed Cleanup/optimization (fixed)

Remove technical terms from InlineForeignKeyField/ModelMultipleChoiceField error messages

Reported by: Jon Dufresne Owned by: nobody
Component: Forms Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Some error messages in django.forms.models use technical jargon that is often very confusing to normal web users. For example, the words "foreign key" and "primary key". I think the error messages should target a general web audience instead of developers.

Scenario: A ModelForm is used to submit GET requests. A user copies a URL with a query string and passes it to a friend. Upon entering the URL, a typo is introduced. This typo results in an error that could read:

"123a" is not a valid value for a primary key.

Most web users have no idea what a primary key is and therefore will be confused by what steps to take to fix the error. I think Django should avoid technical database terms in user facing error messages.

I'm proposing the following changes, but I'm very open to alternative phrasing that would give a more useful error message in more situations:

"%(pk)s" is not a valid value for a primary key.

Becomes

"%(pk)s" is not a valid value.

And

The inline foreign key did not match the parent instance primary key.

Becomes

The inline value did not match the parent instance.

Change History (4)

comment:1 by Jon Dufresne, 8 years ago

Has patch: set

comment:2 by Tim Graham, 8 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Tim Graham, 8 years ago

Summary: User facing error messages should avoid technical jargonRemove technical terms from InlineForeignKeyField/ModelMultipleChoiceField error messages
Triage Stage: AcceptedReady for checkin

comment:4 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: newclosed

In 7edeeb74:

Fixed #27957 -- Removed technical terms from InlineForeignKeyField/ModelMultipleChoiceField error messages.

Note: See TracTickets for help on using tickets.
Back to Top