From e889b69dd2028be4010dcad5688809c03ff4e2e2 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 1 Mar 2010 14:34:24 +0000 Subject: [PATCH] Fixed #12966 - Force unicode of verbose labels in admin change messages. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12627 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/options.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index d61074b19a..2cda5d5d69 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -561,16 +561,16 @@ class ModelAdmin(BaseModelAdmin): for formset in formsets: for added_object in formset.new_objects: change_message.append(_('Added %(name)s "%(object)s".') - % {'name': added_object._meta.verbose_name, + % {'name': force_unicode(added_object._meta.verbose_name), 'object': force_unicode(added_object)}) for changed_object, changed_fields in formset.changed_objects: change_message.append(_('Changed %(list)s for %(name)s "%(object)s".') % {'list': get_text_list(changed_fields, _('and')), - 'name': changed_object._meta.verbose_name, + 'name': force_unicode(changed_object._meta.verbose_name), 'object': force_unicode(changed_object)}) for deleted_object in formset.deleted_objects: change_message.append(_('Deleted %(name)s "%(object)s".') - % {'name': deleted_object._meta.verbose_name, + % {'name': force_unicode(deleted_object._meta.verbose_name), 'object': force_unicode(deleted_object)}) change_message = ' '.join(change_message) return change_message or _('No fields changed.')