mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #28906 -- Removed unnecessary bool() calls.
This commit is contained in:
@@ -139,7 +139,7 @@ class BaseForm:
|
||||
if self._errors is None:
|
||||
is_valid = "Unknown"
|
||||
else:
|
||||
is_valid = self.is_bound and not bool(self._errors)
|
||||
is_valid = self.is_bound and not self._errors
|
||||
return '<%(cls)s bound=%(bound)s, valid=%(valid)s, fields=(%(fields)s)>' % {
|
||||
'cls': self.__class__.__name__,
|
||||
'bound': self.is_bound,
|
||||
|
||||
@@ -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 bool(value)) or value is None
|
||||
return (isinstance(value, str) and not value) or value is None
|
||||
|
||||
def use_required_attribute(self, initial):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user