Replaced an antiquated pattern.

Thanks Lennart Regebro for pointing it out.
This commit is contained in:
Aymeric Augustin 2013-05-17 16:33:36 +02:00
parent b1bfd9630e
commit 9c487b5974
30 changed files with 49 additions and 43 deletions

View file

@ -775,7 +775,7 @@ class MultiWidget(Widget):
You'll probably want to use this class with MultiValueField.
"""
def __init__(self, widgets, attrs=None):
self.widgets = [isinstance(w, type) and w() or w for w in widgets]
self.widgets = [w() if isinstance(w, type) else w for w in widgets]
super(MultiWidget, self).__init__(attrs)
def render(self, name, value, attrs=None):