From 47f0e3f4cca4a4da67117a1b6ec2cfdcc0e4cf33 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Tue, 6 Nov 2012 18:39:11 +0100 Subject: [PATCH] =?UTF-8?q?[ldap=5Fcrans]=20On=20laisse=20un=20sursis=20d'?= =?UTF-8?q?une=20semaine=20apr=C3=A8s=20paiement=20avant=20de=20d=C3=A9con?= =?UTF-8?q?necter=20pour=20carte=20=C3=A9tudiant=20apr=C3=A8s=20le=2001/11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ignore-this: 5a7ae8cbbb8368cbb2d376b785bda204 darcs-hash:20121106173911-3a55a-40830d547ded3ba9876f3fd1656025710b53f0f8.gz --- gestion/config.py | 2 ++ gestion/ldap_crans.py | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gestion/config.py b/gestion/config.py index 634dd521..17bdf016 100644 --- a/gestion/config.py +++ b/gestion/config.py @@ -44,6 +44,8 @@ bl_carte_et_actif = False # Hard (l'adhérent est considéré comme paiement pas ok) bl_carte_et_definitif = False +#Sursis pour les inscription après le 1/11 pour fournir la carte étudiant +sursis_carte=8*24*3600 # Gel des cableurs pas a jour de cotisation # Les droits ne sont pas retires mais il n'y a plus de sudo diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index 7948bba1..a84c144a 100644 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -977,7 +977,12 @@ class BaseClasseCrans(CransLdap): elif isinstance(self, Adherent) and (config.ann_scol in self.paiement()): # blacklistes virtuelle si on est un adhérent pour carte étudiant et chambre invalides if not config.periode_transitoire and config.bl_carte_et_actif and not (config.ann_scol in self.carteEtudiant()): - actifs['carte_etudiant']=('-','-') + for h in self.historique()[::-1]: + x=re.match("(.*),.* : .*paiement\+%s.*" % config.ann_scol,h) + if x != None: + if (time.time()-time.mktime(time.strptime(x.group(1),'%d/%m/%Y %H:%M')))>config.sursis_carte: + actifs['carte_etudiant']=('-','-') + break if self.chbre() == '????': actifs['chambre_invalide']=('-','-')