diff --git a/src/pretix/base/views/mixins.py b/src/pretix/base/views/mixins.py index 157f80543..386e991ee 100644 --- a/src/pretix/base/views/mixins.py +++ b/src/pretix/base/views/mixins.py @@ -135,6 +135,8 @@ class BaseQuestionsViewMixin: question_field.initial = getattr(question_field, 'initial', None) or src['initial'] if 'validators' in src: question_field.validators += src['validators'] + if 'label' in src: + question_field.label = src['label'] if len(form.fields) > 0: formlist.append(form) diff --git a/src/pretix/presale/checkoutflow.py b/src/pretix/presale/checkoutflow.py index 0507932a5..a4981316c 100644 --- a/src/pretix/presale/checkoutflow.py +++ b/src/pretix/presale/checkoutflow.py @@ -840,6 +840,8 @@ class QuestionsStep(CartQuestionsViewMixin, CartMixin, TemplateFlowStep): f.fields[fname].disabled = val['disabled'] if 'validators' in val and fname in f.fields: f.fields[fname].validators += val['validators'] + if 'label' in val and fname in f.fields: + f.fields[fname].label = val['label'] return f @@ -944,6 +946,8 @@ class QuestionsStep(CartQuestionsViewMixin, CartMixin, TemplateFlowStep): f.fields[fname].disabled = val['disabled'] if 'validators' in val and fname in f.fields: f.fields[fname].validators += val['validators'] + if 'label' in val and fname in f.fields: + f.fields[fname].label = val['label'] return f diff --git a/src/pretix/presale/signals.py b/src/pretix/presale/signals.py index 007f9f459..685648c9e 100644 --- a/src/pretix/presale/signals.py +++ b/src/pretix/presale/signals.py @@ -233,7 +233,7 @@ Arguments: ``request``, ``order`` This signal allows you to override fields of the contact form that is presented during checkout and by default only asks for the email address. It is also being used for the invoice address form. You are supposed to return a dictionary of dictionaries with globally unique keys. The -value-dictionary should contain one or more of the following keys: ``initial``, ``disabled``, +value-dictionary should contain one or more of the following keys: ``label``, ``initial``, ``disabled``, ``validators``. The key of the dictionary should be the name of the form field. As with all event plugin signals, the ``sender`` keyword argument will contain the event. A ``request`` @@ -264,9 +264,9 @@ Arguments: ``position``, ``request`` This signal allows you to override fields of the questions form that is presented during checkout and by default only asks for the questions configured in the backend. You are supposed to return a dictionary of dictionaries with globally unique keys. The value-dictionary should contain one or -more of the following keys: ``initial``, ``disabled``, ``validators``. The key of the dictionary -should be the form field name for system fields (e.g. ``company``), or the question's ``identifier`` -for user-defined questions. +more of the following keys: ``label``, ``initial``, ``disabled``, ``validators``. The key of the +dictionary should be the form field name for system fields (e.g. ``company``), or the question's +``identifier`` for user-defined questions. The ``position`` keyword argument will contain a ``CartPosition`` or ``OrderPosition`` object.