mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 09:58:23 +02:00
✨ Adhere to parent clubs automatically, adhere to Kfet automatically when registering to the WEI
This commit is contained in:
@ -6,6 +6,8 @@ from django.contrib.auth.models import User
|
||||
from django.db.models import Q
|
||||
from django.forms import CheckboxSelectMultiple
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from note.models import NoteSpecial
|
||||
from note_kfet.inputs import AmountInput, DatePickerInput, Autocomplete, ColorWidget
|
||||
|
||||
from ..models import WEIClub, WEIRegistration, Bus, BusTeam, WEIMembership, WEIRole
|
||||
@ -75,6 +77,35 @@ class WEIMembershipForm(forms.ModelForm):
|
||||
widget=CheckboxSelectMultiple(),
|
||||
)
|
||||
|
||||
credit_type = forms.ModelChoiceField(
|
||||
queryset=NoteSpecial.objects.all(),
|
||||
label=_("Credit type"),
|
||||
empty_label=_("No credit"),
|
||||
required=False,
|
||||
)
|
||||
|
||||
credit_amount = forms.IntegerField(
|
||||
label=_("Credit amount"),
|
||||
widget=AmountInput(),
|
||||
initial=0,
|
||||
required=False,
|
||||
)
|
||||
|
||||
last_name = forms.CharField(
|
||||
label=_("Last name"),
|
||||
required=False,
|
||||
)
|
||||
|
||||
first_name = forms.CharField(
|
||||
label=_("First name"),
|
||||
required=False,
|
||||
)
|
||||
|
||||
bank = forms.CharField(
|
||||
label=_("Bank"),
|
||||
required=False,
|
||||
)
|
||||
|
||||
def clean(self):
|
||||
cleaned_data = super().clean()
|
||||
if cleaned_data["team"] is not None and cleaned_data["team"].bus != cleaned_data["bus"]:
|
||||
|
Reference in New Issue
Block a user