Opened 7 years ago

Closed 7 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:
Needs tests: Patch needs improvement:
Easy pickings: UI/UX:

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 7 years ago.
A possible fix using force_unicode()

Download all attachments as: .zip

Change History (2)

Changed 7 years ago by ramiro

A possible fix using force_unicode()

comment:1 Changed 7 years ago by kmtracey

  • Resolution set to fixed
  • Status changed from new to closed

(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