ENvoi d'un mail a l'ajout d'un droit

darcs-hash:20070930222454-c992d-e095f3df4f71daf684647530414df5c5529a43b5.gz
This commit is contained in:
bos 2007-10-01 00:24:54 +02:00
parent 0ad16b5186
commit 29ef7f488e
2 changed files with 9 additions and 4 deletions

View file

@ -439,6 +439,6 @@ Si tu as des questions, n'h
--
Les nounous"""
pages_infos_droits = { "Câbleur" : "https://wiki.crans.org/%C3%8AtreC%C3%A2bleur",
pages_infos_droits = { "Cableur" : "https://wiki.crans.org/%C3%8AtreC%C3%A2bleur",
"Imprimeur" : "https://wiki.crans.org/%C3%8AtreC%C3%A2bleur/%C3%8AtreImprimeur",
"Bureau" : "https://wiki.crans.org/%C3%8AtreC%C3%A2bleur/%C3%8AtreLeBureau" }

View file

@ -2180,6 +2180,8 @@ class Adherent(BaseProprietaire):
def droits(self, droits=None):
""" droits est la liste des droits à donner à l'utilisateur """
""" ATTENTION : il y a une autre fonction droits_lights derrière celle-çi,
pensez à faire vos modifs sur les deux """
if droits != None and 'cransAccount' not in self._data.get('objectClass', []):
raise EnvironmentError(u'Il faut avoir un compte pour avoir des droits.')
@ -2202,9 +2204,9 @@ class Adherent(BaseProprietaire):
new.append(droit.encode('utf-8'))
ancien = self._data.get('droits',[])
#for droit in new:
#if droit not in ancien:
#db.services_to_restart("mail_ajout_droits", {"Login" : "passoir", "Droit" : "balayeur"})
for droit in new:
if droit not in ancien:
db.services_to_restart("mail_ajout_droits", self.compte().encode('latin-1') + ":" + droit)
if new != self._data.get('droits', []):
self._set('droits', new)
@ -2231,6 +2233,9 @@ class Adherent(BaseProprietaire):
new.append(droit.encode('utf-8'))
ancien = self._data.get('droits',[])
for droit in new:
if droit not in ancien:
db.services_to_restart("mail_ajout_droits", self.compte().encode('latin-1') + ":" + droit)
diff = []
for droit in new:
if droit not in ancien: