From cb1b5a07c74648ced68a21818f4aa069b98a9575 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Wed, 29 May 2019 09:27:24 +0200 Subject: [PATCH] Make all settings fields optional --- .../pretix_servicefees/settings.html | 3 +++ pretix_servicefees/views.py | 20 ++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/pretix_servicefees/templates/pretix_servicefees/settings.html b/pretix_servicefees/templates/pretix_servicefees/settings.html index 3fe5084..98ea886 100644 --- a/pretix_servicefees/templates/pretix_servicefees/settings.html +++ b/pretix_servicefees/templates/pretix_servicefees/settings.html @@ -14,6 +14,9 @@
{% trans "Service fees with resellers" %} +

+ {% trans "If you keep values empty, we will fall back to the values from above. If you do not want to charge any fees through this sales channel, set them to zero explicity." %} +

{% bootstrap_field form.service_fee_per_ticket_resellers addon_after=request.event.currency layout="control" %} {% bootstrap_field form.service_fee_abs_resellers addon_after=request.event.currency layout="control" %} {% bootstrap_field form.service_fee_percent_resellers addon_after="%" layout="control" %} diff --git a/pretix_servicefees/views.py b/pretix_servicefees/views.py index b9f1031..a2567e6 100644 --- a/pretix_servicefees/views.py +++ b/pretix_servicefees/views.py @@ -9,27 +9,37 @@ from pretix.helpers.money import change_decimal_field class ServiceFeeSettingsForm(SettingsForm): - service_fee_abs = forms.DecimalField(label=_('Fixed fee per order')) + service_fee_abs = forms.DecimalField( + label=_('Fixed fee per order'), + required=False + ) service_fee_percent = forms.DecimalField( label=_('Percentual fee per order'), help_text=_('Percentage of the order total. Note that this percentage will currently only ' 'be calculated on the summed price of sold tickets, not on other fees like e.' - 'g. shipping fees, if there are any.') + 'g. shipping fees, if there are any.'), + required=False ) service_fee_per_ticket = forms.DecimalField( label=_('Fixed fee per ticket'), - help_text=_('This fee will be added for each ticket sold, except for free items and addons.') + help_text=_('This fee will be added for each ticket sold, except for free items and addons.'), + required=False ) - service_fee_abs_resellers = forms.DecimalField(label=_('Fixed fee per order')) + service_fee_abs_resellers = forms.DecimalField( + label=_('Fixed fee per order'), + required=False + ) service_fee_percent_resellers = forms.DecimalField( label=_('Percentual fee per order'), help_text=_('Percentage of the order total. Note that this percentage will currently only ' 'be calculated on the summed price of sold tickets, not on other fees like e.' - 'g. shipping fees, if there are any.') + 'g. shipping fees, if there are any.'), + required=False ) service_fee_per_ticket_resellers = forms.DecimalField( label=_('Fixed fee per ticket'), + required=False, help_text=_('This fee will be added for each ticket sold, except for free items and addons.') )