Opened 16 years ago

Closed 16 years ago

Last modified 12 years ago

#7075 closed (fixed)

BUG FIX: Unicode migration breaks django.contrib.admin.views.main.quote

Reported by: Wang Chun <wangchun@…> Owned by: nobody
Component: contrib.admin Version: dev
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This affects django.contrib.admin.views.main.ChangeList.url_for_result:

def url_for_result(self, result):
    return "%s/" % quote(getattr(result, self.pk_attname))

Which no longer works after the Unicode migration, because getattr now returns unicode instead of str.

If someone use a string as a primary key, and the string contains "_[0-9A-Fa-f]{2}", the record will not be editable in admin interface.

Attachments (1)

r7450.diff (511 bytes ) - added by Wang Chun <wangchun@…> 16 years ago.

Download all attachments as: .zip

Change History (7)

by Wang Chun <wangchun@…>, 16 years ago

Attachment: r7450.diff added

comment:1 by Wang Chun <wangchun@…>, 16 years ago

Has patch: set

comment:2 by Jeff Anderson, 16 years ago

Needs tests: set
Triage Stage: UnreviewedAccepted

Would a regression test be appropriate/necessary here?

comment:3 by Michael Radziej, 16 years ago

milestone: 1.0
Resolution: worksforme
Status: newclosed

comment:4 by Michael Radziej, 16 years ago

Resolution: worksforme
Status: closedreopened

sorry, didn't want to close this ticket. The quoted code line is still there, in spite of newforms admin.

comment:5 by Julien Phalip, 16 years ago

Resolution: fixed
Status: reopenedclosed

I can't find the actual changeset, but this has been fixed anyway. It now sits in django.contrib.admin.util.quote, and all string types -- including unicodes -- should work since it accepts any basestring object.

comment:6 by Jacob, 12 years ago

milestone: 1.0

Milestone 1.0 deleted

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