Skip to content
Browse files

newforms-admin: Fixed #4963. We now use force_unicode instead of str …

…for creating django.contrib.admin.LogEntry objects.

git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@6327 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent a922c20 commit e51a819595cbb5f2b142a995d766820c1e1fa661 @jkocherhans jkocherhans committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/contrib/admin/options.py
View
4 django/contrib/admin/options.py
@@ -366,7 +366,7 @@ def save_add(self, request, model, form, formsets, post_url_continue):
formset.save()
pk_value = new_object._get_pk_val()
- LogEntry.objects.log_action(request.user.id, ContentType.objects.get_for_model(model).id, pk_value, str(new_object), ADDITION)
+ 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': opts.verbose_name, 'obj': new_object}
# Here, we distinguish between different save types by checking for
# the presence of keys in request.POST.
@@ -425,7 +425,7 @@ def save_change(self, request, model, form, formsets=None):
#change_message = ' '.join(change_message)
if not change_message:
change_message = _('No fields changed.')
- LogEntry.objects.log_action(request.user.id, ContentType.objects.get_for_model(model).id, pk_value, str(new_object), CHANGE, change_message)
+ 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': opts.verbose_name, 'obj': new_object}
if request.POST.has_key("_continue"):

0 comments on commit e51a819

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