Opened 7 years ago

Closed 5 years ago

Last modified 5 years ago

#12418 closed Bug (fixed)

object_detail ObjectDoesNotExist message isn't unicode

Reported by: Matthias Kestenholz 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 Matthias Kestenholz 7 years ago.
fix12418.patch (3.0 KB) - added by Matthias Kestenholz 6 years ago.

Download all attachments as: .zip

Change History (10)

Changed 7 years ago by Matthias Kestenholz

Attachment: list_detail.patch added

comment:1 Changed 7 years ago by Russell Keith-Magee

Needs tests: set
Triage Stage: UnreviewedAccepted

comment:2 Changed 6 years ago by Matthias Kestenholz

Needs tests: unset

Changed 6 years ago by Matthias Kestenholz

Attachment: fix12418.patch added

comment:3 Changed 6 years ago by Russell Keith-Magee

Patch needs improvement: set

Needs to be updated for class-based views.

comment:4 Changed 6 years ago by Matthias Kestenholz

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

comment:5 Changed 6 years ago by Matt McClanahan

Severity: Normal
Type: Bug

comment:6 Changed 5 years ago by Claude Paroz

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 5 years ago by Aymeric Augustin

Resolution: fixed
Status: newclosed

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 5 years ago by Matthias Kestenholz

Thanks!

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