From 0145e71cebccb4729e00a31b04db5591614d04d0 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Fri, 13 Jul 2007 11:05:01 +0000 Subject: [PATCH] Fixed #4846 -- Fixed some Python 2.3 encoding problems in the admin interface. Based on a patch from daybreaker12@gmail.com. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5683 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/views/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py index 7e3f36c291..874b3559ee 100644 --- a/django/contrib/admin/views/main.py +++ b/django/contrib/admin/views/main.py @@ -261,7 +261,7 @@ def add_stage(request, app_label, model_name, show_delete=False, form_url='', po new_object = manipulator.save(new_data) pk_value = new_object._get_pk_val() LogEntry.objects.log_action(request.user.id, ContentType.objects.get_for_model(model).id, pk_value, force_unicode(new_object), ADDITION) - msg = _('The %(name)s "%(obj)s" was added successfully.') % {'name': force_unicode(opts.verbose_name), 'obj': new_object} + msg = _('The %(name)s "%(obj)s" was added successfully.') % {'name': force_unicode(opts.verbose_name), 'obj': force_unicode(new_object)} # Here, we distinguish between different save types by checking for # the presence of keys in request.POST. if "_continue" in request.POST: @@ -349,7 +349,7 @@ def change_stage(request, app_label, model_name, object_id): change_message = _('No fields changed.') LogEntry.objects.log_action(request.user.id, ContentType.objects.get_for_model(model).id, pk_value, force_unicode(new_object), CHANGE, change_message) - msg = _('The %(name)s "%(obj)s" was changed successfully.') % {'name': force_unicode(opts.verbose_name), 'obj': new_object} + msg = _('The %(name)s "%(obj)s" was changed successfully.') % {'name': force_unicode(opts.verbose_name), 'obj': force_unicode(new_object)} if "_continue" in request.POST: request.user.message_set.create(message=msg + ' ' + _("You may edit it again below.")) if '_popup' in request.REQUEST: @@ -357,7 +357,7 @@ def change_stage(request, app_label, model_name, object_id): else: return HttpResponseRedirect(request.path) elif "_saveasnew" in request.POST: - request.user.message_set.create(message=_('The %(name)s "%(obj)s" was added successfully. You may edit it again below.') % {'name': force_unicode(opts.verbose_name), 'obj': new_object}) + request.user.message_set.create(message=_('The %(name)s "%(obj)s" was added successfully. You may edit it again below.') % {'name': force_unicode(opts.verbose_name), 'obj': force_unicode(new_object)}) return HttpResponseRedirect("../%s/" % pk_value) elif "_addanother" in request.POST: request.user.message_set.create(message=msg + ' ' + (_("You may add another %s below.") % force_unicode(opts.verbose_name)))