From a28d9660dd8e09f0751585c139b2692aed68f7a5 Mon Sep 17 00:00:00 2001 From: Nanoy Date: Wed, 23 Jan 2019 10:42:54 +0100 Subject: [PATCH] Fix invalidation --- users/templates/users/profile.html | 1 - users/views.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/users/templates/users/profile.html b/users/templates/users/profile.html index 27b9b26..fcdb7bf 100644 --- a/users/templates/users/profile.html +++ b/users/templates/users/profile.html @@ -80,7 +80,6 @@ console.log(baseColor) $.get("http://www.thecolorapi.com/scheme?rgb=" + baseColor + "&mode=analogic&count={{products | length}}", function( data ) { colors = data.colors - console.log(colors) var bgColor = [] for(var i = 0; i < colors.length; i++){ color = colors[i] diff --git a/users/views.py b/users/views.py index 71f59ae..8777b55 100644 --- a/users/views.py +++ b/users/views.py @@ -922,7 +922,7 @@ def invalidateCotisationHistory(request, pk): user = cotisationHistory.user user.profile.cotisationEnd = user.profile.cotisationEnd - timedelta(days=cotisationHistory.duration) if(cotisationHistory.paymentMethod.affect_balance): - user.profile.balance += cotisation.amount + user.profile.debit -= cotisationHistory.cotisation.amount user.save() messages.success(request, "La cotisation a bien été invalidée") return HttpResponseRedirect(request.META.get('HTTP_REFERER'))