From 5a7e367e9c7a2f5637839f7e166926dc60ee9c43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Elliott=20B=C3=A9cue?= Date: Sat, 29 Aug 2015 21:36:18 +0200 Subject: [PATCH] =?UTF-8?q?=C2=AB=C2=A0BONJOUR,=20J'AI=20CLIQU=C3=89=20SUR?= =?UTF-8?q?=20CONNEXION=20ET=20=C3=87A=20NE=20M'A=20PAS=20R=C3=89ADH=C3=89?= =?UTF-8?q?R=C3=89=C2=A0=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gestion/gest_crans.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gestion/gest_crans.py b/gestion/gest_crans.py index 3ad046ea..5a11268e 100755 --- a/gestion/gest_crans.py +++ b/gestion/gest_crans.py @@ -1524,12 +1524,16 @@ def set_connexion(proprio): # Si l'adhérent ne l'est plus, on commence par le faire adhérer, sauf s'il a une facture adhésion. adhEnd = proprio.adhesion() + if in_facture is not None: adhEnd = max(adhEnd, fromGeneralizedTimeFormat(in_facture._data.get('finAdhesion', ["19700101000000Z"])[0])) - if adhEnd < time(): + + if adhEnd - cotisation.delai_readh < time(): stat = set_adhesion(proprio) - if stat == 1: + + if stat == 1 and adhEnd < time(): return 1 + if in_facture is not None: adhEnd = max(adhEnd, fromGeneralizedTimeFormat(in_facture._data.get('finAdhesion', ["19700101000000Z"])[0])) @@ -1554,7 +1558,8 @@ def set_connexion(proprio): annul, res = dialog(args) if annul: - in_facture.supprime(pop=True) + if in_facture is not None: + in_facture.supprime(pop=True) return 1 res = res[0] if res == "An":