From 2a26dcfc1638db69d0f5a48d04512f06295ce84d Mon Sep 17 00:00:00 2001 From: pauget Date: Tue, 14 Sep 2004 23:08:54 +0200 Subject: [PATCH] 2me changement annonc dans le dernier commit fait darcs-hash:20040914210854-41617-787d7de3e75121332be978ae2f66e29d215a5021.gz --- gestion/gen_confs/switchs.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/gestion/gen_confs/switchs.py b/gestion/gen_confs/switchs.py index dcf05ec3..bab886a1 100755 --- a/gestion/gen_confs/switchs.py +++ b/gestion/gen_confs/switchs.py @@ -129,15 +129,13 @@ exit def configure_chbre(self,chbre) : """ Recontigure la chambre fournie chambre """ bat = chbre[0].lower() - a = self.db.search('chbre=%s' % chbre) - action = '' - for proprio in a['adherent'] + a['club'] : - if (((ann_scol in proprio.paiement()) or ((ann_scol-1) in proprio.paiement() and localtime()[1]==9)) and 'bloq' not in proprio.blacklist_actif()) : - # Il faut activer la prise - anim('\tactivation chbre %s' % chbre) - action = 'enable' - break - if action == '' : + a = self.db.search('chbre=%s&paiement=%i' % (chbre,ann_scol)) + a = a['adherent'] + a['club'] + if a and 'bloq' not in a[0].blacklist_actif() : + # Il faut activer la prise + anim('\tactivation chbre %s' % chbre) + action = 'enable' + else : # Il faut désactiver la prise anim('\tdésactivation chbre %s' % chbre) action = 'disable'