#26978: Improve the message attached to the 404 raised by get_object_or_404 and
get_list_or_404
----------------------------------+--------------------------------------
     Reporter:  ewjoachim         |                    Owner:
         Type:  Uncategorized     |                   Status:  new
    Component:  Error reporting   |                  Version:  1.9
     Severity:  Normal            |               Resolution:
     Keywords:  404, object_name  |             Triage Stage:  Unreviewed
    Has patch:  0                 |      Needs documentation:  0
  Needs tests:  0                 |  Patch needs improvement:  0
Easy pickings:  0                 |                    UI/UX:  0
----------------------------------+--------------------------------------
Changes (by ewjoachim):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Old description:

> == 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 or a feature...)
>
> == Code : ==
>
> https://github.com/django/django/blob/64aba7a8aba06b8be52a1a099b44e1d3be4bdd26/django/shortcuts.py#L93

New description:

 == 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 : ==

 
https://github.com/django/django/blob/64aba7a8aba06b8be52a1a099b44e1d3be4bdd26/django/shortcuts.py#L93

--

--
Ticket URL: <https://code.djangoproject.com/ticket/26978#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/067.d2baee43ee055524ead7252fdf3880e5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to