summaryrefslogtreecommitdiff
path: root/django/forms
diff options
context:
space:
mode:
authorJames Bennett <ubernostrum@gmail.com>2010-03-03 08:19:23 +0000
committerJames Bennett <ubernostrum@gmail.com>2010-03-03 08:19:23 +0000
commitfaa341e61bd01fff44b3537545c3678a5f0bf48c (patch)
tree68d6cf09eab98574e7245156796e9fd7e29ca97e /django/forms
parent1d12aa2cfe5bf8e9fc36baefb1f9e1bedb9d5b93 (diff)
[1.1.X] Expanded the fix in [12663] to cover CSS declarations, which were also affected by the bug. Refs #12879. Backport of [12665] from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12666 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/forms')
-rw-r--r--django/forms/widgets.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/django/forms/widgets.py b/django/forms/widgets.py
index ffab039829..95c42ea055 100644
--- a/django/forms/widgets.py
+++ b/django/forms/widgets.py
@@ -87,7 +87,9 @@ class Media(StrAndUnicode):
def add_css(self, data):
if data:
for medium, paths in data.items():
- self._css.setdefault(medium, []).extend([path for path in paths if path not in self._css[medium]])
+ for path in paths:
+ if not self._css.get(medium) or path not in self._css[medium]:
+ self._css.setdefault(medium, []).append(path)
def __add__(self, other):
combined = Media()