From 3c99b0f3e90a15fd541361df8114d272f5082652 Mon Sep 17 00:00:00 2001 From: bleizi Date: Sun, 9 Jul 2023 11:23:33 +0200 Subject: [PATCH] do not change transactions date when validating/deleting credit-soge (and typo) --- apps/treasury/models.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/treasury/models.py b/apps/treasury/models.py index e079a543..fc20da3b 100644 --- a/apps/treasury/models.py +++ b/apps/treasury/models.py @@ -1,4 +1,4 @@ -# Copyright (C) 2018-2021 by BDE ENS Paris-Saclay +# Copyright (C) 2018-2023 by BDE ENS Paris-Saclay # SPDX-License-Identifier: GPL-3.0-or-later from datetime import date @@ -326,7 +326,7 @@ class SogeCredit(models.Model): if self.valid or not self.pk: return -# Soge do not pay BDE and kfet memberships this year (2022-2023) +# Soge do not pay BDE and kfet memberships since 2022 # bde = Club.objects.get(name="BDE") # kfet = Club.objects.get(name="Kfet") # bde_qs = Membership.objects.filter(user=self.user, club=bde, date_start__gte=bde.membership_start) @@ -388,7 +388,6 @@ class SogeCredit(models.Model): for tr in self.transactions.all(): tr.valid = True tr._force_save = True - tr.created_at = timezone.now() tr.save() @transaction.atomic @@ -437,12 +436,11 @@ class SogeCredit(models.Model): for tr in self.transactions.all(): tr._force_save = True tr.valid = True - tr.created_at = timezone.now() tr.save() if self.credit_transaction: # If the soge credit is deleted while the user is not validated yet, # there is not credit transaction. - # There is a credit transaction iff the user declares that no bank account + # There is a credit transaction if the user declares that no bank account # was opened after the validation of the account. self.credit_transaction.valid = False self.credit_transaction.reason += " (invalide)"