[ldap_crans] Import plus global
This commit is contained in:
parent
81ffc8ab5b
commit
46836d8999
1 changed files with 1 additions and 4 deletions
|
@ -27,6 +27,7 @@ from numeros_disponibles import lister_ip_dispo
|
|||
from unicodedata import normalize
|
||||
import secrets_new as secrets
|
||||
import ridtools
|
||||
from user_tests import isadm
|
||||
|
||||
date_format = '%d/%m/%Y %H:%M'
|
||||
date_format_new = '%d/%m/%Y %H:%M:%S'
|
||||
|
@ -1530,7 +1531,6 @@ class BaseProprietaire(BaseClasseCrans):
|
|||
if new == None:
|
||||
return liste
|
||||
|
||||
from user_tests import isadm
|
||||
if not isadm() and isadm(self.compte()):
|
||||
raise EnvironmentError(u'Il faut être administrateur pour effectuer cette opération.')
|
||||
|
||||
|
@ -2507,7 +2507,6 @@ class Adherent(BaseProprietaire):
|
|||
|
||||
# Si pas light, il faut être Nounou
|
||||
if not light:
|
||||
from user_tests import isadm
|
||||
if not isadm():
|
||||
raise EnvironmentError(u'Il faut être administrateur pour effectuer cette opération.')
|
||||
|
||||
|
@ -3210,7 +3209,6 @@ Contactez nounou si la MAC est bien celle d'une carte.""", 3)
|
|||
Enregistre la machine courante dans la base LDAP
|
||||
Retourne une chaîne indiquant les opération effectuées.
|
||||
"""
|
||||
from user_tests import isadm
|
||||
if self.proprietaire().__class__ == AssociationCrans and not (isadm() or user_tests.getuser() == 'www-data'):
|
||||
raise EnvironmentError(u'Il faut être administrateur pour effectuer cette opération.')
|
||||
|
||||
|
@ -3293,7 +3291,6 @@ Contactez nounou si la MAC est bien celle d'une carte.""", 3)
|
|||
|
||||
def delete(self, comment=''):
|
||||
""" Destruction de la machine"""
|
||||
from user_tests import isadm
|
||||
if self.proprietaire().__class__ == AssociationCrans and not isadm():
|
||||
raise EnvironmentError(u'Il faut être administrateur pour effectuer cette opération.')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue