[attributs] On évite d'utiliser hasattr
Actuellement, ça retourne les attribut de self.value donc c'est confusionnant
This commit is contained in:
parent
8477760302
commit
83b2e65a9d
1 changed files with 10 additions and 2 deletions
12
attributs.py
12
attributs.py
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue