Commit 83b2e65a authored by Valentin Samir's avatar Valentin Samir

[attributs] On évite d'utiliser hasattr

Actuellement, ça retourne les attribut de self.value donc c'est confusionnant
parent 84777603
......@@ -1185,6 +1185,10 @@ class responsable(Attr):
ldap_name = "responsable"
python_type = int # en vrai, c'est l'aid du responsable
def __init__(self, *args, **kwargs):
self._value = None
return super(responsable, self).__init__(*args, **kwargs)
def nonefunction(self, resp):
"""
Just... do... nothing.
......@@ -1198,7 +1202,7 @@ class responsable(Attr):
"""Méthode spéciale, pour aller avec
property. On génère le respo quand
c'est nécessaire, pas avant."""
if hasattr(self, "_value"):
if self._value is not None:
return self._value
else:
try:
......@@ -1224,6 +1228,10 @@ class imprimeurClub(Attr):
can_modify = [cableur, nounou]
ldap_name = "imprimeurClub"
def __init__(self, *args, **kwargs):
self._value = None
return super(imprimeurClub, self).__init__(*args, **kwargs)
def nonefunction(self, imprimeur):
"""
Just... do... nothing.
......@@ -1234,7 +1242,7 @@ class imprimeurClub(Attr):
pass
def get_imprimeur(self):
if hasattr(self, "_value"):
if self._value is not None:
return self._value
else:
try:
......
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