from config import $X -> import config; config.$X

Comme ça, on pourra envisager de reload un module de config après un certain
temps.
This commit is contained in:
Daniel STAN 2014-11-18 13:32:33 +01:00
parent c636fcca6d
commit 524e8ee000
4 changed files with 19 additions and 19 deletions

View file

@ -764,13 +764,13 @@ class CransLdap:
# définifif (cf config.py).
if config.periode_transitoire:
# Pour la période transitoire année précédente ok
el = "(|(paiement=%d)(paiement=%d)(finAdhesion>=%s))" % (ann_scol, ann_scol-1, generalizedTimeFormat(time.time()))
el = "(|(paiement=%d)(paiement=%d)(finAdhesion>=%s))" % (config.ann_scol, config.ann_scol-1, generalizedTimeFormat(time.time()))
else:
el = "(|(paiement=%s)(finAdhesion>=%s))" % (ann_scol, generalizedTimeFormat(time.time()))
el = "(|(paiement=%s)(finAdhesion>=%s))" % (config.ann_scol, generalizedTimeFormat(time.time()))
# Doit-on bloquer en cas de manque de la carte d'etudiant ?
# (si période transitoire on ne bloque dans aucun cas)
if config.bl_carte_et_definitif:
el = "(&(|(carteEtudiant=%d)(objectClass=club)(carteEtudiant=TRUE))%s)" % (ann_scol, el)
el = "(&(|(carteEtudiant=%d)(objectClass=club)(carteEtudiant=TRUE))%s)" % (config.ann_scol, el)
elif champ[1:] == 'blacklist':
el = '(blacklist=%s)' % expr
else:
@ -2796,7 +2796,7 @@ class Club(BaseProprietaire):
return strip_accents(self.Nom())
def carteEtudiant(self, pd=None):
return [ ann_scol ]
return [ config.ann_scol ]
def responsable(self, adher=None):
""" Responsable du club, adher doit être une instance de la classe adhérent """
@ -4243,9 +4243,9 @@ class _FakeProprio(CransLdap):
raise ValueError("Impossible de blacklister %r" % str(self))
return []
def paiement(self):
return [ ann_scol ]
return [ config.ann_scol ]
def carteEtudiant(self):
return [ ann_scol ]
return [ config.ann_scol ]
def blacklist_actif(self):
return []
def mail(self, new=None):