[config,firewall_new,ipt,ldap_crans] bl_carte_et_definitif = True, sursis d'une semaine même avec bl_carte_et_definitif
Ignore-this: aef64ec3880b96beda0ec95c7c6c255c darcs-hash:20121119160943-3a55a-309f4e1bf82cc4ef955c7a7a723220704e74ba18.gz
This commit is contained in:
parent
11f461576b
commit
b92229f0f1
4 changed files with 63 additions and 21 deletions
|
@ -892,7 +892,7 @@ class CransLdap:
|
|||
if uid == "grosminet":
|
||||
proprio = self.search("nom=grosminet", mode)['adherent'][0]
|
||||
return proprio
|
||||
|
||||
|
||||
__machines = ()
|
||||
def all_machines(self, graphic=False):
|
||||
"""
|
||||
|
@ -907,8 +907,14 @@ class CransLdap:
|
|||
# Machines de l'assoce
|
||||
self.__machines = AssociationCrans(conn = self.conn).machines()
|
||||
# Machines des adhérents et clubs de l'année en cours
|
||||
base = self.search('paiement=ok')
|
||||
#base = self.search('paiement=ok')
|
||||
base = self.search('paiement=%s' % ann_scol)
|
||||
base = base['adherent'] + base['club']
|
||||
if config.periode_transitoire:
|
||||
tmp=self.search('paiement=%s' % ann_scol-1)
|
||||
base.entend(tmp['adherent'] + tmp['club'])
|
||||
del tmp
|
||||
base=[a for a in base if a.paiement_ok()]
|
||||
if graphic: a = anim('\tTri des machines', len(base))
|
||||
for adh in base:
|
||||
if graphic: a.cycle()
|
||||
|
@ -976,13 +982,8 @@ class BaseClasseCrans(CransLdap):
|
|||
bl_liste += p.blacklist()
|
||||
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()):
|
||||
for h in self.historique()[::-1]:
|
||||
x=re.match("(.*),.* : .*(paiement\+%s|inscription).*" % 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 not config.periode_transitoire and config.bl_carte_et_actif and not (config.ann_scol in self.carteEtudiant()) and not self.sursis_carte():
|
||||
actifs['carte_etudiant']=('-','-')
|
||||
if self.chbre() == '????':
|
||||
actifs['chambre_invalide']=('-','-')
|
||||
|
||||
|
@ -1735,6 +1736,25 @@ class BaseProprietaire(BaseClasseCrans):
|
|||
si négatif le supprime
|
||||
"""
|
||||
return self._an('paiement', action)
|
||||
|
||||
def sursis_carte(self):
|
||||
for h in self.historique()[::-1]:
|
||||
x=re.match("(.*),.* : .*(paiement\+%s|inscription).*" % 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:
|
||||
return True
|
||||
break
|
||||
return False
|
||||
|
||||
def paiement_ok(self):
|
||||
if config.ann_scol in self.paiement() or (config.periode_transitoire and (config.ann_scol-1) in self.paiement()):
|
||||
if config.periode_transitoire or not isinstance(self, Adherent) or not config.bl_carte_et_definitif or config.ann_scol in self.carteEtudiant():
|
||||
return True
|
||||
else:
|
||||
return self.sursis_carte()
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
def delete(self, comment=''):
|
||||
"""Destruction du propriétaire"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue