[object] Blacklist virtuelle pour les gens non à jour du paiement
This commit is contained in:
parent
f199947a5d
commit
f7036290d5
1 changed files with 8 additions and 2 deletions
10
objets.py
10
objets.py
|
@ -434,7 +434,7 @@ class CransLdapObject(object):
|
||||||
out.append(u"%s : [%s] %s" % (date, author, u" ; ".join(mod_list)))
|
out.append(u"%s : [%s] %s" % (date, author, u" ; ".join(mod_list)))
|
||||||
return out
|
return out
|
||||||
|
|
||||||
def blacklist_actif(self):
|
def blacklist_actif(self, excepts=[]):
|
||||||
"""Renvoie la liste des blacklistes actives sur l'entité
|
"""Renvoie la liste des blacklistes actives sur l'entité
|
||||||
Améliorations possibles:
|
Améliorations possibles:
|
||||||
- Proposer de filtrer les blacklistes avec un arg supplémentaire ?
|
- Proposer de filtrer les blacklistes avec un arg supplémentaire ?
|
||||||
|
@ -449,9 +449,15 @@ class CransLdapObject(object):
|
||||||
if self['chbre'][0].value == '????':
|
if self['chbre'][0].value == '????':
|
||||||
bl = attributs.blacklist(u'%s$%s$%s$%s' % ('-', '-', 'chambre_invalide', ''), {}, self.conn)
|
bl = attributs.blacklist(u'%s$%s$%s$%s' % ('-', '-', 'chambre_invalide', ''), {}, self.conn)
|
||||||
blacklist_liste.append(bl)
|
blacklist_liste.append(bl)
|
||||||
|
elif self.__class__.__name__ == "adherent":
|
||||||
|
bl = attributs.blacklist(u'%s$%s$%s$%s' % ('-', '-', 'paiement', ''), {}, self.conn)
|
||||||
|
blacklist_liste.append(bl)
|
||||||
attrs = (self.attrs if self.mode not in ["w", "rw"] else self._modifs)
|
attrs = (self.attrs if self.mode not in ["w", "rw"] else self._modifs)
|
||||||
blacklist_liste.extend(filter((lambda bl: bl.is_actif()), attrs.get("blacklist",[])))
|
blacklist_liste.extend(filter((lambda bl: bl.is_actif()), attrs.get("blacklist",[])))
|
||||||
return blacklist_liste
|
if excepts:
|
||||||
|
return [ b for b in blacklist_liste if b.value['type'] not in excepts ]
|
||||||
|
else:
|
||||||
|
return blacklist_liste
|
||||||
|
|
||||||
def blacklist(self, sanction, commentaire, debut="now", fin = '-'):
|
def blacklist(self, sanction, commentaire, debut="now", fin = '-'):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue