Commit f502e593 authored by chirac's avatar chirac
Browse files

On met des datetime timezone aware

parent 89f8ee7c
......@@ -12,7 +12,7 @@ from cotisations.models import NewFactureForm, EditFactureForm, Facture, Article
from users.models import User
from dateutil.relativedelta import relativedelta
import datetime
from django.utils import timezone
def form(ctx, template, request):
c = ctx
......@@ -27,9 +27,10 @@ def end_adhesion(user):
def create_cotis(facture, user, article):
""" Update et crée l'objet cotisation associé à une facture, prend en argument l'user, la facture pour la quantitéi, et l'article pour la durée"""
date_max = end_adhesion(user) or
if date_max:
date_max = end_adhesion(user) or
if date_max <
datemax =
cotisation.date_end = cotisation.date_start + relativedelta(months=article[0].duration*facture.number)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment