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']=('-','-')