Opened 18 years ago

Closed 18 years ago

#4545 closed (fixed)

[unicode] Admin crashed if delete object with unicode-contained primary key

Reported by: hidded <me@…> Owned by: Adrian Holovaty
Component: contrib.admin Version: other branch
Severity: Keywords: unicode admin
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Subj.

Testcase: create tag 'превед медвед' and try to delete it.

class Tag(models.Model):
        title = models.CharField(maxlength=255, primary_key='True')

        class Admin:
                pass

Traceback:

Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py" in get_response
  77. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/views/decorators.py" in _checklogin
  55. return view_func(request, *args, **kwargs)
File "/usr/lib/python2.5/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  39. response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/views/main.py" in delete_stage
  506. deleted_objects = [u'%s: <a href="../../%s/">%s</a>' % (force_unicode(capfirst(opts.verbose_name)), object_id, escape(obj)), []]

  UnicodeDecodeError at /admin/blog/tag/hello ворлд/delete/
  'ascii' codec can't decode byte 0xd0 in position 6: ordinal not in range(128)

Attachments (1)

admin-crash-if-delete-unicode-contained-primary-key.diff (848 bytes ) - added by hidded <me@…> 18 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 by Malcolm Tredinnick, 18 years ago

Keywords: unicode-branch removed
Summary: Admin crashed if delete object with unicode-contained primary key[unicode] Admin crashed if delete object with unicode-contained primary key

Fixed title. Removed "unicode-branch" keyword, since that is being used for another purpose.

comment:2 by Malcolm Tredinnick, 18 years ago

Resolution: fixed
Status: newclosed

Fixed in [5480].

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