mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #31155 -- Fixed a system check for the longest choice when a named group contains only non-string values.
Regression in b6251956b6.
Thanks Murat Guchetl for the report.
This commit is contained in:
@@ -269,10 +269,10 @@ class Field(RegisterLookupMixin):
|
||||
):
|
||||
break
|
||||
if self.max_length is not None and group_choices:
|
||||
choice_max_length = max(
|
||||
choice_max_length = max([
|
||||
choice_max_length,
|
||||
*(len(value) for value, _ in group_choices if isinstance(value, str)),
|
||||
)
|
||||
])
|
||||
except (TypeError, ValueError):
|
||||
# No groups, choices in the form [value, display]
|
||||
value, human_name = group_name, group_choices
|
||||
|
||||
Reference in New Issue
Block a user