#7075 closed (fixed)
BUG FIX: Unicode migration breaks django.contrib.admin.views.main.quote
Reported by: | 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 |
Pull Requests: | How to create a pull request | ||
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.
Change History (7)
by , 17 years ago
Attachment: | r7450.diff added |
---|
comment:1 by , 17 years ago
Has patch: | set |
---|
comment:2 by , 17 years ago
Needs tests: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 17 years ago
milestone: | → 1.0 |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
comment:4 by , 17 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
sorry, didn't want to close this ticket. The quoted code line is still there, in spite of newforms admin.
comment:5 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
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.
Would a regression test be appropriate/necessary here?