[gestion] Gestion plus propre des changements d'annee

Ajout d'une variable periode_transitoire dans config.py qui definit les
periodes ou on accepte ceux qui ont paye l'annee precedente (on ne prend pas du
tout en compte la carte d'etudiant dans ces periodes).
On en profite pour enlever toute notion de caution ...

darcs-hash:20100801103904-ddb99-cad90eb5599173bec23ff3952b3d22f80fd618f2.gz
This commit is contained in:
Michel Blockelet 2010-08-01 12:39:04 +02:00
parent 5feb3042ee
commit 26dfe36d93
4 changed files with 42 additions and 38 deletions

View file

@ -9,7 +9,7 @@ from affich_tools import *
from gen_confs import gen_config
from ldap_crans import crans_ldap, ann_scol
from time import localtime
from config import bl_carte_et_actif
from config import bl_carte_et_actif, periode_transitoire
class squid(gen_config) :
db = crans_ldap()
@ -82,8 +82,8 @@ class squid_check(gen_config):
m = s[0]
p = m.proprietaire()
to_regen.extend(m.blacklist_actif())
from config import bl_carte_et_actif
if (bl_carte_et_actif and ann_scol not in p.carteEtudiant()):
if (bl_carte_et_actif and not periode_transitoire and ann_scol
not in p.carteEtudiant()):
to_regen.append('carte')
if p.chbre() == '????':
to_regen.append('chbre')
@ -163,7 +163,7 @@ class squid_bloq(squid) :
class squid_carte(squid) :
""" Génère le fichier blacklist-carte pour squid """
actif = bl_carte_et_actif
actif = bl_carte_et_actif and not periode_transitoire
if not actif : restart_cmd = ''
FICHIER = "/etc/squid3/blacklist_carte_et"
chaine = "carteEtudiant!=%i"%ann_scol