From 39eaf3ad6a13883603c7f314ab4149c5b5cc3b47 Mon Sep 17 00:00:00 2001 From: Felix Rindt Date: Fri, 20 Sep 2019 09:34:24 +0200 Subject: [PATCH] Code style improvements (#1411) * docstring corrections * move omit_hyphen formfield --- src/pretix/base/payment.py | 2 +- src/pretix/plugins/banktransfer/payment.py | 18 +++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/pretix/base/payment.py b/src/pretix/base/payment.py index 1a61d8844f..e4b4f80371 100644 --- a/src/pretix/base/payment.py +++ b/src/pretix/base/payment.py @@ -531,7 +531,7 @@ class BasePaymentProvider: containing the URL the user will be redirected to. If you are done with your process you should return the user to the order's detail page. - If the payment is completed, you should call ``payment.confirm()``. Please note that ``this`` might + If the payment is completed, you should call ``payment.confirm()``. Please note that this might raise a ``Quota.QuotaExceededException`` if (and only if) the payment term of this order is over and some of the items are sold out. You should use the exception message to display a meaningful error to the user. diff --git a/src/pretix/plugins/banktransfer/payment.py b/src/pretix/plugins/banktransfer/payment.py index 6408ebe016..326e037fec 100644 --- a/src/pretix/plugins/banktransfer/payment.py +++ b/src/pretix/plugins/banktransfer/payment.py @@ -102,7 +102,12 @@ class BankTransfer(BasePaymentProvider): label=_('Payment method name'), widget=I18nTextInput, required=False - )) + )), + ('omit_hyphen', forms.BooleanField( + label=_('Do not include a hypen in the payment reference.'), + help_text=_('This is required in some countries.'), + required=False + )), ]) @property @@ -116,16 +121,7 @@ class BankTransfer(BasePaymentProvider): @property def settings_form_fields(self): - d = OrderedDict( - list(super().settings_form_fields.items()) + list(BankTransfer.form_fields().items()) + [ - ('omit_hyphen', forms.BooleanField( - label=_('Do not include a hypen in the payment reference.'), - help_text=_('This is required in some countries.'), - required=False - )), - - ] - ) + d = OrderedDict(list(super().settings_form_fields.items()) + list(BankTransfer.form_fields().items())) d.move_to_end('bank_details', last=False) d.move_to_end('bank_details_sepa_bank', last=False) d.move_to_end('bank_details_sepa_bic', last=False)