Opened 9 years ago

Closed 8 years ago

Last modified 5 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: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: UI/UX:


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@…> 9 years ago.

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by Wang Chun <wangchun@…>

Attachment: r7450.diff added

comment:1 Changed 9 years ago by Wang Chun <wangchun@…>

Has patch: set
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

comment:2 Changed 8 years ago by Jeff Anderson

Needs tests: set
Triage Stage: UnreviewedAccepted

Would a regression test be appropriate/necessary here?

comment:3 Changed 8 years ago by Michael Radziej

milestone: 1.0
Resolution: worksforme
Status: newclosed

comment:4 Changed 8 years ago by Michael Radziej

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 Changed 8 years ago by Julien Phalip

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 Changed 5 years ago by Jacob

milestone: 1.0

Milestone 1.0 deleted

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