1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-30 04:13:01 +00:00

Merge branch 'SogeCreditDate' into 'main'

link SogeCredit to WEI by creation date instead of civil year

See merge request bde/nk20!206
This commit is contained in:
bleizi 2023-01-17 15:58:52 +01:00
commit 84b16ab603

View File

@ -310,8 +310,8 @@ class SogeCredit(models.Model):
amount = sum(transaction.total for transaction in self.transactions.all()) amount = sum(transaction.total for transaction in self.transactions.all())
if 'wei' in settings.INSTALLED_APPS: if 'wei' in settings.INSTALLED_APPS:
from wei.models import WEIMembership from wei.models import WEIMembership
if not WEIMembership.objects.filter(club__weiclub__year=datetime.date.today().year, user=self.user)\ if not WEIMembership.objects\
.exists(): .filter(club__weiclub__year=self.credit_transaction.created_at.year, user=self.user).exists():
# 80 € for people that don't go to WEI # 80 € for people that don't go to WEI
amount += 8000 amount += 8000
return amount return amount