mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Fix country fields always being required
This commit is contained in:
@@ -397,13 +397,14 @@ class BaseQuestionsForm(forms.Form):
|
|||||||
)
|
)
|
||||||
elif q.type == Question.TYPE_COUNTRYCODE:
|
elif q.type == Question.TYPE_COUNTRYCODE:
|
||||||
field = CountryField(
|
field = CountryField(
|
||||||
countries=CachedCountries
|
countries=CachedCountries,
|
||||||
|
blank=True, null=True, blank_label=' ',
|
||||||
).formfield(
|
).formfield(
|
||||||
label=label, required=required,
|
label=label, required=required,
|
||||||
help_text=help_text,
|
help_text=help_text,
|
||||||
widget=forms.Select,
|
widget=forms.Select,
|
||||||
empty_label='',
|
empty_label=' ',
|
||||||
initial=initial.answer if initial else guess_country(event),
|
initial=initial.answer if initial else (guess_country(event) if required else None),
|
||||||
)
|
)
|
||||||
elif q.type == Question.TYPE_CHOICE:
|
elif q.type == Question.TYPE_CHOICE:
|
||||||
field = forms.ModelChoiceField(
|
field = forms.ModelChoiceField(
|
||||||
|
|||||||
Reference in New Issue
Block a user