Opened 8 years ago

Closed 8 years ago

#26992 closed Bug (needsinfo)

On admin change view, exception raised from __unicode__ method of model related by fk is "hidden" and instead view without form shown

Reported by: okrutny Owned by: nobody
Component: contrib.admin Version: 1.9
Severity: Normal Keywords: change empty exception
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 okrutny)

I have a model PolcardPayments which references Order by fk.

class PolcardPayments(models.Model):
    order = models.ForeignKey(Order, null=True)
Order.__unicode__

was not correctly implemented, raising UnicodeEncodeError.

When I entered change view of PolcardPayments as admin, form was not shown. I found in logs that UnicodeEncodeError is raised.

Expected behavour would be to raise 500 error and process same way as other such errors.

Attachments (1)

empty_change_view.png (18.8 KB ) - added by okrutny 8 years ago.
empty change view

Download all attachments as: .zip

Change History (4)

by okrutny, 8 years ago

Attachment: empty_change_view.png added

empty change view

comment:1 by okrutny, 8 years ago

Description: modified (diff)

comment:2 by Tim Graham, 8 years ago

I guess it might be the expected exception silencing of the {% include %} template tag. Could you try to do a little investigation to tell us exactly where the exception silencing is happening?

comment:3 by Tim Graham, 8 years ago

Resolution: needsinfo
Status: newclosed

If that's not the issue, then please provide a more complete sample project that reproduces the issue and reopen the ticket. Thanks.

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