From 475dd8c091a84eb86614dd6e4379ddf4c3f9f798 Mon Sep 17 00:00:00 2001 From: Nanoy Date: Fri, 11 Jan 2019 08:46:29 +0100 Subject: [PATCH 1/2] Fix cotisation --- users/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/users/views.py b/users/views.py index 03c1fc9..ca37f2f 100644 --- a/users/views.py +++ b/users/views.py @@ -8,6 +8,7 @@ from django.http import HttpResponse, HttpResponseRedirect from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator from django.contrib.auth.decorators import login_required, permission_required from django.forms.models import model_to_dict +from django.utils import timezone import simplejson as json from datetime import datetime, timedelta @@ -878,7 +879,7 @@ def addCotisationHistory(request, pk): cotisation.coopeman = request.user cotisation.amount = cotisation.cotisation.amount cotisation.duration = cotisation.cotisation.duration - if(user.profile.cotisationEnd): + if(user.profile.cotisationEnd and user.profile.cotisationEnd > timezone.now()): cotisation.endDate = user.profile.cotisationEnd + timedelta(days=cotisation.cotisation.duration) else: cotisation.endDate = datetime.now() + timedelta(days=cotisation.cotisation.duration) From bb7ed6a706345238816d1bcd8b7004eee6e6cc0d Mon Sep 17 00:00:00 2001 From: Nanoy Date: Fri, 11 Jan 2019 08:49:59 +0100 Subject: [PATCH 2/2] Update changelog et version --- CHANGELOG.md | 2 ++ templates/footer.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66f21a3..006f2e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## v3.2.2 +* Fix cotisation cancer ## v3.2.1 * Le module django_tex est directement inclu dans le projet (disparition du module sur pip) ## v3.2.0 diff --git a/templates/footer.html b/templates/footer.html index 11893b6..c2618ec 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -39,6 +39,6 @@
  • Facebook
  • - +