Commit f64cda37 authored by Valentin Samir's avatar Valentin Samir

[objets] Petits details sur history_gen

parent 84cfaac8
......@@ -297,7 +297,7 @@ class CransLdapObject(object):
def history_gen(self, attr=None, login=None):
"Génère une ligne d'historique pour l'arribut attr ou une ligne par attributs pour l'objet courant"
if attr is None:
for attr in self.attrs.keys():
for attr in self.keys():
self.history_gen(attr)
def partial_name(name, max_len=14, start=7, end=7):
if len(name) > max_len:
......@@ -318,8 +318,8 @@ class CransLdapObject(object):
return
if attr.historique not in ["full", "partial", "info"]:
raise ValueError("Format d'historique %s inconnu" % attr.historique)
old_values = self.attrs[attr.ldap_name]
new_values = self._modifs[attr.ldap_name]
old_values = self.attrs.get(attr.ldap_name, [])
new_values = self._modifs.get(attr.ldap_name, [])
if old_values == new_values:
return
comm = None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment