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
1 changed files with 1 additions and 1 deletions

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)