diff options
| author | James Bennett <ubernostrum@gmail.com> | 2010-03-03 08:17:51 +0000 |
|---|---|---|
| committer | James Bennett <ubernostrum@gmail.com> | 2010-03-03 08:17:51 +0000 |
| commit | 6edcd11aedc1dca4d67fdbe7478d40406dc88730 (patch) | |
| tree | e39a3839c06d3876f6e4fb2b719489c956e0d618 /django/forms/widgets.py | |
| parent | 9a82ca0a36798d0ca33353cd933cdbc8da0f677b (diff) | |
Expanded the fix in [12663] to cover CSS declarations, which were also affected by the bug. Refs #12879.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12665 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/forms/widgets.py')
| -rw-r--r-- | django/forms/widgets.py | 4 |
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() |
