Opened 8 years ago
Closed 8 years ago
#26978 closed Cleanup/optimization (invalid)
Improve the message attached to the 404 raised by get_object_or_404 and get_list_or_404
Reported by: | Joachim Jablon | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | 1.9 |
Severity: | Normal | Keywords: | 404, object_name |
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 )
The problem :
If no object is returned by get_object_or_404 and get_list_or_404, they raise an Http404 error for which the error message contains the model._meta.object_name
. This name should not really be shown to the user within the normal workflow. Classes have a verbose_name
that is more appropriate.
Moreover, this message should be translatable.
(not sure if it's really a bug report or a feature request...)
Code :
Change History (4)
comment:1 by , 8 years ago
Description: | modified (diff) |
---|
comment:2 by , 8 years ago
Component: | Error reporting → Core (Other) |
---|---|
Owner: | set to |
Type: | Uncategorized → Cleanup/optimization |
comment:3 by , 8 years ago
I just realized (and tested) that the message of the Http404 was actually never shown by default. And for #24733, the fact that the view can have access to the exception does not make its message user facing. If developers decide to copy exception message to their pages, that's their responsability.
I might have been a little too fast in opening the ticket. Sorry for the noise.
comment:4 by , 8 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Is the idea that these messages might be user-facing since #24733?