Simplified widgets.Select._choice_has_empty_value().

This commit is contained in:
Sergey Fedoseev 2017-12-08 08:14:25 +05:00
parent 2b81faab25
commit 23a27f2c03
1 changed files with 1 additions and 1 deletions

View File

@ -681,7 +681,7 @@ class Select(ChoiceWidget):
def _choice_has_empty_value(choice):
"""Return True if the choice's value is empty string or None."""
value, _ = choice
return (isinstance(value, str) and not value) or value is None
return value is None or value == ''
def use_required_attribute(self, initial):
"""