Code

Ticket #4545: admin-crash-if-delete-unicode-contained-primary-key.diff

File admin-crash-if-delete-unicode-contained-primary-key.diff, 848 bytes (added by hidded <me@…>, 7 years ago)
Line 
1Index: /usr/lib/python2.5/site-packages/django/contrib/admin/views/main.py
2===================================================================
3--- /usr/lib/python2.5/site-packages/django/contrib/admin/views/main.py (revision 5460)
4+++ /usr/lib/python2.5/site-packages/django/contrib/admin/views/main.py (working copy)
5@@ -503,7 +503,7 @@
6 
7     # Populate deleted_objects, a data structure of all related objects that
8     # will also be deleted.
9-    deleted_objects = [u'%s: <a href="../../%s/">%s</a>' % (force_unicode(capfirst(opts.verbose_name)), object_id, escape(obj)), []]
10+    deleted_objects = [u'%s: <a href="../../%s/">%s</a>' % (force_unicode(capfirst(opts.verbose_name)), force_unicode(object_id), escape(obj)), []]
11     perms_needed = sets.Set()
12     _get_deleted_objects(deleted_objects, perms_needed, request.user, obj, opts, 1)
13