Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #8910 -- Added force_unicode during admin log message creation …

…to avoid triggering a Python 2.3 bug. Thanks for the report joshg and patch nfg.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9383 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 6ed91234e39370ba979df09686a301f014573508 1 parent 7760ae7
Karen Tracey authored
6  django/contrib/admin/options.py
@@ -342,16 +342,16 @@ def construct_change_message(self, request, form, formsets):
342 342
                 for added_object in formset.new_objects:
343 343
                     change_message.append(_('Added %(name)s "%(object)s".')
344 344
                                           % {'name': added_object._meta.verbose_name,
345  
-                                             'object': added_object})
  345
+                                             'object': force_unicode(added_object)})
346 346
                 for changed_object, changed_fields in formset.changed_objects:
347 347
                     change_message.append(_('Changed %(list)s for %(name)s "%(object)s".')
348 348
                                           % {'list': get_text_list(changed_fields, _('and')),
349 349
                                              'name': changed_object._meta.verbose_name,
350  
-                                             'object': changed_object})
  350
+                                             'object': force_unicode(changed_object)})
351 351
                 for deleted_object in formset.deleted_objects:
352 352
                     change_message.append(_('Deleted %(name)s "%(object)s".')
353 353
                                           % {'name': deleted_object._meta.verbose_name,
354  
-                                             'object': deleted_object})
  354
+                                             'object': force_unicode(deleted_object)})
355 355
         change_message = ' '.join(change_message)
356 356
         return change_message or _('No fields changed.')
357 357
     
2  tests/regressiontests/admin_views/tests.py
@@ -76,7 +76,7 @@ def testBasicEditPost(self):
76 76
             "article_set-0-id": u"1",
77 77
             # there is no title in database, give one here or formset
78 78
             # will fail.
79  
-            "article_set-0-title": u"Need a title.",
  79
+            "article_set-0-title": u"Norske bostaver æøå skaper problemer",
80 80
             "article_set-0-content": u"<p>Middle content</p>",
81 81
             "article_set-0-date_0": u"2008-03-18",
82 82
             "article_set-0-date_1": u"11:54:58",

0 notes on commit 6ed9123

Please sign in to comment.
Something went wrong with that request. Please try again.