mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-08-03 22:24:34 +02:00
Merge branch 'wei' into 'main'
Soge credit fixed See merge request bde/nk20!336
This commit is contained in:
18
apps/wei/migrations/0017_alter_weiclub_fee_soge_credit.py
Normal file
18
apps/wei/migrations/0017_alter_weiclub_fee_soge_credit.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.2.4 on 2025-08-02 13:43
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('wei', '0016_weiregistration_fee_alter_weiclub_fee_soge_credit'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='weiclub',
|
||||
name='fee_soge_credit',
|
||||
field=models.PositiveIntegerField(default=0, verbose_name='membership fee (soge credit)'),
|
||||
),
|
||||
]
|
@@ -40,7 +40,7 @@ class WEIClub(Club):
|
||||
|
||||
fee_soge_credit = models.PositiveIntegerField(
|
||||
verbose_name=_("membership fee (soge credit)"),
|
||||
default=2000,
|
||||
default=0,
|
||||
)
|
||||
|
||||
class Meta:
|
||||
|
@@ -798,11 +798,6 @@ class WEIUpdateRegistrationView(ProtectQuerysetMixin, LoginRequiredMixin, Update
|
||||
choose_bus_form.fields["team"].queryset = BusTeam.objects.filter(bus__wei=context["club"])
|
||||
context["membership_form"] = choose_bus_form
|
||||
|
||||
if not self.object.soge_credit and self.object.user.profile.soge:
|
||||
form = context["form"]
|
||||
form.fields["soge_credit"].disabled = True
|
||||
form.fields["soge_credit"].help_text = _("You already opened an account in the Société générale.")
|
||||
|
||||
return context
|
||||
|
||||
def get_form(self, form_class=None):
|
||||
@@ -823,6 +818,10 @@ class WEIUpdateRegistrationView(ProtectQuerysetMixin, LoginRequiredMixin, Update
|
||||
form.fields["deposit_type"].required = True
|
||||
form.fields["deposit_type"].help_text = _("Choose how you want to pay the deposit")
|
||||
|
||||
if self.object.user.profile.soge:
|
||||
form.fields["soge_credit"].disabled = True
|
||||
form.fields["soge_credit"].help_text = _("You already opened an account in the Société générale.")
|
||||
|
||||
return form
|
||||
|
||||
def get_membership_form(self, data=None, instance=None):
|
||||
|
Reference in New Issue
Block a user