Code

Opened 7 years ago

Closed 7 years ago

#4545 closed (fixed)

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

Reported by: hidded <me@…> Owned by: adrian
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: UI/UX:

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@…> 7 years ago.

Download all attachments as: .zip

Change History (3)

Changed 7 years ago by hidded <me@…>

comment:1 Changed 7 years ago by mtredinnick

  • Keywords unicode-branch removed
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from Admin crashed if delete object with unicode-contained primary key to [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 Changed 7 years ago by mtredinnick

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

Fixed in [5480].

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.