summaryrefslogtreecommitdiff
path: root/django/forms/widgets.py
diff options
context:
space:
mode:
authorMoritz Sichert <moritz.sichert@googlemail.com>2015-03-10 21:21:28 +0100
committerTim Graham <timograham@gmail.com>2015-03-18 09:11:01 -0400
commit6bff3439894ac22d80f270f36513fc86586273f3 (patch)
treee48e6b1e22cbf909e8cd41dc77c5e86f0e0c4ecd /django/forms/widgets.py
parent465edf2bb2b6dd6158b198922dc0f185a15cc715 (diff)
Refs #24469 -- Fixed escaping of forms, fields, and media in non-Django templates.
Diffstat (limited to 'django/forms/widgets.py')
-rw-r--r--django/forms/widgets.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/forms/widgets.py b/django/forms/widgets.py
index 2ce3f42d6a..9a73ddb9ca 100644
--- a/django/forms/widgets.py
+++ b/django/forms/widgets.py
@@ -51,6 +51,9 @@ class Media(object):
for name in MEDIA_TYPES:
getattr(self, 'add_' + name)(media_attrs.get(name, None))
+ def __html__(self):
+ return force_text(self)
+
def __str__(self):
return self.render()