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
This commit is contained in:
parent
7760ae754a
commit
6ed91234e3
|
@ -342,16 +342,16 @@ class ModelAdmin(BaseModelAdmin):
|
||||||
for added_object in formset.new_objects:
|
for added_object in formset.new_objects:
|
||||||
change_message.append(_('Added %(name)s "%(object)s".')
|
change_message.append(_('Added %(name)s "%(object)s".')
|
||||||
% {'name': added_object._meta.verbose_name,
|
% {'name': added_object._meta.verbose_name,
|
||||||
'object': added_object})
|
'object': force_unicode(added_object)})
|
||||||
for changed_object, changed_fields in formset.changed_objects:
|
for changed_object, changed_fields in formset.changed_objects:
|
||||||
change_message.append(_('Changed %(list)s for %(name)s "%(object)s".')
|
change_message.append(_('Changed %(list)s for %(name)s "%(object)s".')
|
||||||
% {'list': get_text_list(changed_fields, _('and')),
|
% {'list': get_text_list(changed_fields, _('and')),
|
||||||
'name': changed_object._meta.verbose_name,
|
'name': changed_object._meta.verbose_name,
|
||||||
'object': changed_object})
|
'object': force_unicode(changed_object)})
|
||||||
for deleted_object in formset.deleted_objects:
|
for deleted_object in formset.deleted_objects:
|
||||||
change_message.append(_('Deleted %(name)s "%(object)s".')
|
change_message.append(_('Deleted %(name)s "%(object)s".')
|
||||||
% {'name': deleted_object._meta.verbose_name,
|
% {'name': deleted_object._meta.verbose_name,
|
||||||
'object': deleted_object})
|
'object': force_unicode(deleted_object)})
|
||||||
change_message = ' '.join(change_message)
|
change_message = ' '.join(change_message)
|
||||||
return change_message or _('No fields changed.')
|
return change_message or _('No fields changed.')
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ class AdminViewBasicTest(TestCase):
|
||||||
"article_set-0-id": u"1",
|
"article_set-0-id": u"1",
|
||||||
# there is no title in database, give one here or formset
|
# there is no title in database, give one here or formset
|
||||||
# will fail.
|
# will fail.
|
||||||
"article_set-0-title": u"Need a title.",
|
"article_set-0-title": u"Norske bostaver æøå skaper problemer",
|
||||||
"article_set-0-content": u"<p>Middle content</p>",
|
"article_set-0-content": u"<p>Middle content</p>",
|
||||||
"article_set-0-date_0": u"2008-03-18",
|
"article_set-0-date_0": u"2008-03-18",
|
||||||
"article_set-0-date_1": u"11:54:58",
|
"article_set-0-date_1": u"11:54:58",
|
||||||
|
|
Loading…
Reference in New Issue