Opened 17 years ago
Closed 17 years ago
#9129 closed (fixed)
unicode support on admin delete
| Reported by: | Ricardo | Owned by: | nobody |
|---|---|---|---|
| Component: | contrib.admin | Version: | 1.0 |
| Severity: | Keywords: | unicode, admin, delete | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Having the admin app in other language (portuguese, btw) and while trying to delete a record holding non-ascii characters it fails with:
'ascii' codec can't encode character u'\x??' in position ?: ordinal not in range(128)
I replaced contrib.admin.options.py, in delete_view()
if request.POST: # The user has already confirmed the deletion.
if perms_needed:
raise PermissionDenied
obj_display = str(obj)
obj.delete()
with
if request.POST: # The user has already confirmed the deletion.
if perms_needed:
raise PermissionDenied
obj_display = u"%s" % obj
obj.delete()
looks ok.
I hold revision 8600 but diff'd against 9000 (haven't had time to sort django-multilingual difference)
Attachments (1)
Change History (2)
by , 17 years ago
| Attachment: | t9129-r9067.diff added |
|---|
comment:1 by , 17 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
A possible fix using force_unicode()