diff options
| author | Daniel Hahler <github@thequod.de> | 2018-03-03 19:35:09 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-03-03 13:35:09 -0500 |
| commit | 683341db4396d92e4578d348b7fcce3312df505d (patch) | |
| tree | 184cbdd24993f1d23db4283478c6ca2b6f20a4ca /django/forms/widgets.py | |
| parent | 3d8fadad0f7a3a32f28db034650182117ae071f7 (diff) | |
Condensed some widgets code.
Diffstat (limited to 'django/forms/widgets.py')
| -rw-r--r-- | django/forms/widgets.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/django/forms/widgets.py b/django/forms/widgets.py index f3a6b38f46..50e41b59ec 100644 --- a/django/forms/widgets.py +++ b/django/forms/widgets.py @@ -161,10 +161,8 @@ def media_property(cls): for medium in extend: m = m + base[medium] return m + Media(definition) - else: - return Media(definition) - else: - return base + return Media(definition) + return base return property(_media) @@ -188,10 +186,7 @@ class Widget(metaclass=MediaDefiningClass): supports_microseconds = True def __init__(self, attrs=None): - if attrs is not None: - self.attrs = attrs.copy() - else: - self.attrs = {} + self.attrs = {} if attrs is None else attrs.copy() def __deepcopy__(self, memo): obj = copy.copy(self) |
