Opened 16 years ago

Closed 16 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)

t9129-r9067.diff (534 bytes ) - added by Ramiro Morales 16 years ago.
A possible fix using force_unicode()

Download all attachments as: .zip

Change History (2)

by Ramiro Morales, 16 years ago

Attachment: t9129-r9067.diff added

A possible fix using force_unicode()

comment:1 by Karen Tracey, 16 years ago

Resolution: fixed
Status: newclosed

(In [9070]) Fixed #9129 -- Restored a force_unicode that was lost when unicode changes were merged to newforms-admin. Thanks Ricardo & Ramiro.

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