Code

Opened 4 years ago

Closed 2 years ago

Last modified 2 years ago

#12418 closed Bug (fixed)

object_detail ObjectDoesNotExist message isn't unicode

Reported by: mk Owned by: nobody
Component: Generic views Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

This leads to messages such as the following if no matching object could be found:

No <django.utils.functional.proxy object at 0x1017b5890> found matching the query

Attachments (2)

list_detail.patch (690 bytes) - added by mk 4 years ago.
fix12418.patch (3.0 KB) - added by mk 4 years ago.

Download all attachments as: .zip

Change History (10)

Changed 4 years ago by mk

comment:1 Changed 4 years ago by russellm

  • Needs documentation unset
  • Needs tests set
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 4 years ago by mk

  • Needs tests unset

Changed 4 years ago by mk

comment:3 Changed 3 years ago by russellm

  • Patch needs improvement set

Needs to be updated for class-based views.

comment:4 Changed 3 years ago by mk

This bug exists in create_update.py, date_based.py and list_detail.py (at least).

comment:5 Changed 3 years ago by mattmcc

  • Severity set to Normal
  • Type set to Bug

comment:6 Changed 2 years ago by claudep

  • Easy pickings unset
  • UI/UX unset

Only deprecated function-based generic views (removed in 1.5) seem to be concerned by this bug.

comment:7 Changed 2 years ago by aaugustin

  • Resolution set to fixed
  • Status changed from new to closed

Yes, the problem is fixed. The equivalent code in django/views/generic/detail.py is:

        try:
            obj = queryset.get()
        except ObjectDoesNotExist:
            raise Http404(_(u"No %(verbose_name)s found matching the query") %
                          {'verbose_name': queryset.model._meta.verbose_name})

comment:8 Changed 2 years ago by mk

Thanks!

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.