From 5d9c7321973d76f7c8208b0f458af5eb2777b609 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Sun, 4 Nov 2012 03:34:38 +0100 Subject: [PATCH] [attributs] Assouplissement sur le formatage de certain attributs --- attributs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/attributs.py b/attributs.py index 74c1cbc..0b98e14 100644 --- a/attributs.py +++ b/attributs.py @@ -205,7 +205,7 @@ class yearAttr(intAttr): def parse_value(self, val, ldif): if int(val) < 1998 or int(val) > config.ann_scol: - raise ValueError("Année invalide (%s)" % val) + raise ValueError("Annee invalide (%s)" % val) self.value = int(val) @@ -471,11 +471,11 @@ class blacklist(Attr): def parse_value(self, bl, ldif): bl_debut, bl_fin, bl_type, bl_comm = bl.split('$') now = time.time() - self.value = { 'debut' : int (bl_debut), + self.value = { 'debut' : bl_debut if bl_debut == '-' else int (bl_debut), 'fin' : bl_fin if bl_fin == '-' else int(bl_fin), 'type' : bl_type, 'comm' : bl_comm, - 'actif' : int(bl_debut) < now and (bl_fin == '-' or int(bl_fin) > now) } + 'actif' : (bl_debut == '-' or int(bl_debut) < now) and (bl_fin == '-' or int(bl_fin) > now) } def is_actif(self): return self.value['actif']