Skip to content
Snippets Groups Projects

Payment choices

Merged Tom Teichler requested to merge payment-choices into master
@@ -8,7 +8,7 @@ from django_select2.forms import ModelSelect2MultipleWidget, ModelSelect2Widget
from material import Fieldset, Layout, Row
from phonenumber_field.formfields import PhoneNumberField
from aleksis.apps.tezor.models.invoice import Invoice
from aleksis.apps.tezor.models.invoice import InvoiceGroup
from aleksis.core.mixins import ExtensibleForm
from aleksis.core.models import Group, Person
@@ -339,7 +339,6 @@ class RegisterEventFinancial(ExtensibleForm):
)
payment_method = forms.ChoiceField(
choices=Invoice.get_variant_choices(),
label=_("Payment method"),
help_text=_(
"Please choose a payment method. "
@@ -347,6 +346,13 @@ class RegisterEventFinancial(ExtensibleForm):
),
)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields["payment_method"].choices = InvoiceGroup.objects.get(
name="Hack'n'Fun-Veranstaltungen"
).get_variant_choices()
class Meta:
model = EventRegistration
fields = ["voucher_code", "donation"]
Loading