1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #33656 -- Fixed MultiWidget crash when compressed value is a tuple.

This commit is contained in:
L
2022-04-22 14:51:39 +08:00
committed by Mariusz Felisiak
parent 4282fd468f
commit 37602e4948
3 changed files with 23 additions and 2 deletions

View File

@@ -884,9 +884,9 @@ class MultiWidget(Widget):
if self.is_localized:
for widget in self.widgets:
widget.is_localized = self.is_localized
# value is a list of values, each corresponding to a widget
# value is a list/tuple of values, each corresponding to a widget
# in self.widgets.
if not isinstance(value, list):
if not isinstance(value, (list, tuple)):
value = self.decompress(value)
final_attrs = context["widget"]["attrs"]