mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Add a label for empty salutation option (Z#23183319) (#4913)
This commit is contained in:
@@ -127,7 +127,13 @@ class NamePartsWidget(forms.MultiWidget):
|
||||
if fname == 'title' and self.titles:
|
||||
widgets.append(Select(attrs=a, choices=[('', '')] + [(d, d) for d in self.titles[1]]))
|
||||
elif fname == 'salutation':
|
||||
widgets.append(Select(attrs=a, choices=[('', '---'), ('empty', '')] + PERSON_NAME_SALUTATIONS))
|
||||
widgets.append(Select(
|
||||
attrs=a,
|
||||
choices=[
|
||||
('', '---'),
|
||||
('empty', '({})'.format(pgettext_lazy("name_salutation", "not specified"))),
|
||||
] + PERSON_NAME_SALUTATIONS
|
||||
))
|
||||
else:
|
||||
widgets.append(self.widget(attrs=a))
|
||||
super().__init__(widgets, attrs)
|
||||
@@ -245,7 +251,10 @@ class NamePartsFormField(forms.MultiValueField):
|
||||
d.pop('validators', None)
|
||||
field = forms.ChoiceField(
|
||||
**d,
|
||||
choices=[('', '---'), ('empty', '')] + PERSON_NAME_SALUTATIONS
|
||||
choices=[
|
||||
('', '---'),
|
||||
('empty', '({})'.format(pgettext_lazy("name_salutation", "not specified"))),
|
||||
] + PERSON_NAME_SALUTATIONS
|
||||
)
|
||||
else:
|
||||
field = forms.CharField(**defaults)
|
||||
|
||||
Reference in New Issue
Block a user