mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #28058 -- Restored empty BoundFields evaluating to True.
Regression in b52c73008a
This commit is contained in:
@@ -53,6 +53,10 @@ class BoundField:
|
||||
for widget in self.field.widget.subwidgets(self.html_name, self.value(), attrs=attrs)
|
||||
)
|
||||
|
||||
def __bool__(self):
|
||||
# BoundField evaluates to True even if it doesn't have subwidgets.
|
||||
return True
|
||||
|
||||
def __iter__(self):
|
||||
return iter(self.subwidgets)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user