1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-26 18:37:12 +00:00

Delete the soge credit if the user declares that one was opened but in the validation form the checkbox was unchecked

This commit is contained in:
Yohann D'ANELLO 2020-10-07 10:46:33 +02:00
parent 0b1bed8048
commit 2f68601e8b

View File

@ -317,7 +317,7 @@ class FutureUserDetailView(ProtectQuerysetMixin, LoginRequiredMixin, FormMixin,
user.profile.save() user.profile.save()
user.refresh_from_db() user.refresh_from_db()
if not soge and SogeCredit.objects.filter(user=user).exists: if not soge and SogeCredit.objects.filter(user=user).exists():
# If the user declared that a bank account was opened but in the validation form the SoGé case was # If the user declared that a bank account was opened but in the validation form the SoGé case was
# unchecked, delete the associated credit # unchecked, delete the associated credit
soge_credit = SogeCredit.objects.get(user=user) soge_credit = SogeCredit.objects.get(user=user)