set the _required attribute on the ModelMultipleChoiceField (#6514)

setting _required forces the CheckoutFieldRenderer to add the "required" bit to the label.
We only need to remove it from the widget attrs to avoid the html input field validation that would force us to check every single box
This commit is contained in:
Lukas Bockstaller
2026-09-02 10:35:19 +02:00
committed by GitHub
parent 58a58eff83
commit 7d93cae2a9
+1 -1
View File
@@ -899,7 +899,7 @@ class BaseQuestionsForm(forms.Form):
field.widget.attrs['data-question-dependency-values'] = escapejson_attr(json.dumps(q.dependency_values))
if q.type != 'M':
field.widget.attrs['required'] = q.required and not self.all_optional
field._required = q.required and not self.all_optional
field._required = q.required and not self.all_optional
field.required = False
return field