From 52a9e15794ac050afb17837a34407722e7249854 Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Sat, 7 Jul 2012 15:29:20 +0200 Subject: [PATCH] Fixed a regression in the user admin page introduced in a92e7f37c4ae84b6b8d8016cc6783211e9047219. a92e7f37c4ae84b6b8d8016cc6783211e9047219 switched most of the internal stuff to format_html. Using format_html in the `render` method of `ReadOnlyPasswordHashWidget` caused it to generate `SafeString` instances. Later these safe strings where returned from `BoundField.__unicode__` which caused force_unicode to loose the "safe" information. This commit fixes that by ensuring that the render method returns `SafeUnicode` instead of `SafeString`. --- django/contrib/auth/forms.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/django/contrib/auth/forms.py b/django/contrib/auth/forms.py index bce8747661..d2cb039e68 100644 --- a/django/contrib/auth/forms.py +++ b/django/contrib/auth/forms.py @@ -1,3 +1,5 @@ +from __future__ import unicode_literals + from django import forms from django.forms.util import flatatt from django.template import loader