mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 09:58:23 +02:00
Add WEI form on signup form
This commit is contained in:
@ -24,11 +24,6 @@ class WEIForm(forms.ModelForm):
|
||||
|
||||
|
||||
class WEIRegistrationForm(forms.ModelForm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
self.fields["payment_method"].empty_label = _("No credit, directly pay with note balance")
|
||||
|
||||
class Meta:
|
||||
model = WEIRegistration
|
||||
exclude = ('wei', 'information_json', )
|
||||
|
@ -133,16 +133,6 @@ class WEIRegistration(models.Model):
|
||||
verbose_name=_("WEI"),
|
||||
)
|
||||
|
||||
payment_method = models.ForeignKey(
|
||||
NoteSpecial,
|
||||
on_delete=models.PROTECT,
|
||||
null=True, # null = no credit, paid with note
|
||||
blank=True,
|
||||
default=None,
|
||||
related_name="+",
|
||||
verbose_name=_("payment method"),
|
||||
)
|
||||
|
||||
soge_credit = models.BooleanField(
|
||||
default=False,
|
||||
verbose_name=_("Credit from Société générale"),
|
||||
|
@ -258,7 +258,6 @@ class WEIRegisterView(ProtectQuerysetMixin, LoginRequiredMixin, CreateView):
|
||||
def get_form(self, form_class=None):
|
||||
form = super().get_form(form_class)
|
||||
form.fields["user"].initial = self.request.user
|
||||
del form.fields["payment_method"]
|
||||
return form
|
||||
|
||||
def form_valid(self, form):
|
||||
@ -280,7 +279,6 @@ class WEIUpdateRegistrationView(ProtectQuerysetMixin, LoginRequiredMixin, Update
|
||||
def get_form(self, form_class=None):
|
||||
form = super().get_form(form_class)
|
||||
del form.fields["user"]
|
||||
del form.fields["payment_method"]
|
||||
return form
|
||||
|
||||
def get_success_url(self):
|
||||
|
Reference in New Issue
Block a user