From e5ab1b08a2f3b358f27663c2f76c25c0d6c6d122 Mon Sep 17 00:00:00 2001 From: Mira Weller Date: Fri, 11 Oct 2024 11:34:13 +0200 Subject: [PATCH] reformat code --- src/pretix/control/forms/item.py | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/pretix/control/forms/item.py b/src/pretix/control/forms/item.py index 2223475d8..2e227004f 100644 --- a/src/pretix/control/forms/item.py +++ b/src/pretix/control/forms/item.py @@ -93,17 +93,26 @@ class CategoryForm(I18nModelForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) + tpl = '{}   {}' self.fields['category_type'] = ChoiceField(widget=RadioSelect, choices=( - ('normal', mark_safe('{}   {}'.format( - _('Normal category'), _('Products in this category are regular products displayed on the front page.'))),), - ('addon', mark_safe('{}   {}'.format( - _('Add-on product category'), _('Products in this category are add-on products and can only be bought as add-ons.'))),), - ('only', mark_safe('{}   {}'.format( - _('Cross-selling category'), _('Products in this category are regular products, but are only shown ' - 'in the cross-selling step, according to the configuration below.'))),), - ('both', mark_safe('{}   {}'.format( - _('Normal + cross-selling category'), _('Products in this category are regular products displayed on the front page, ' - 'but are additionally shown in the cross-selling step, according to the configuration below.'))),), + ('normal', mark_safe(tpl.format( + _('Normal category'), + _('Products in this category are regular products displayed on the front page.') + )),), + ('addon', mark_safe(tpl.format( + _('Add-on product category'), + _('Products in this category are add-on products and can only be bought as add-ons.') + )),), + ('only', mark_safe(tpl.format( + _('Cross-selling category'), + _('Products in this category are regular products, but are only shown in the cross-selling step, ' + 'according to the configuration below.') + )),), + ('both', mark_safe(tpl.format( + _('Normal + cross-selling category'), + _('Products in this category are regular products displayed on the front page, but are additionally ' + 'shown in the cross-selling step, according to the configuration below.') + )),), )) self.fields['category_type'].initial = self.instance.category_type