summaryrefslogtreecommitdiff
path: root/django/forms
diff options
context:
space:
mode:
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 482c718118..81db2a24f3 100644
--- a/django/forms/widgets.py
+++ b/django/forms/widgets.py
@@ -82,7 +82,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()