diff --git a/src/pretix/presale/forms/checkout.py b/src/pretix/presale/forms/checkout.py index ea6e8ff484..20740fadc9 100644 --- a/src/pretix/presale/forms/checkout.py +++ b/src/pretix/presale/forms/checkout.py @@ -32,11 +32,8 @@ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations under the License. -from itertools import chain - from django import forms from django.core.exceptions import ValidationError -from django.utils.encoding import force_str from django.utils.formats import date_format from django.utils.html import escape from django.utils.safestring import mark_safe @@ -168,46 +165,6 @@ class QuestionsForm(BaseQuestionsForm): ) -class AddOnRadioSelect(forms.RadioSelect): - option_template_name = 'pretixpresale/forms/addon_choice_option.html' - - def optgroups(self, name, value, attrs=None): - attrs = attrs or {} - groups = [] - has_selected = False - for index, (option_value, option_label, option_desc) in enumerate(chain(self.choices)): - if option_value is None: - option_value = '' - if isinstance(option_label, (list, tuple)): - raise TypeError('Choice groups are not supported here') - group_name = None - subgroup = [] - groups.append((group_name, subgroup, index)) - - selected = ( - force_str(option_value) in value and - (has_selected is False or self.allow_multiple_selected) - ) - if selected is True and has_selected is False: - has_selected = True - attrs['description'] = option_desc - subgroup.append(self.create_option( - name, option_value, option_label, selected, index, - subindex=None, attrs=attrs, - )) - - return groups - - -class AddOnVariationField(forms.ChoiceField): - def valid_value(self, value): - text_value = force_str(value) - for k, v, d in self.choices: - if value == k or text_value == force_str(k): - return True - return False - - class MembershipForm(forms.Form): required_css_class = 'required' diff --git a/src/pretix/presale/templates/pretixpresale/forms/addon_choice_option.html b/src/pretix/presale/templates/pretixpresale/forms/addon_choice_option.html deleted file mode 100644 index 9c50c79f02..0000000000 --- a/src/pretix/presale/templates/pretixpresale/forms/addon_choice_option.html +++ /dev/null @@ -1,3 +0,0 @@ -{% load rich_text %} -{% include "django/forms/widgets/input.html" %} {{ widget.label }} {% if widget.attrs.description %} -
{{ widget.attrs.description|rich_text }}
{% endif %}