correction bug
This commit is contained in:
parent
66e808f40f
commit
abb643bdbe
@ -235,7 +235,7 @@ class MachineAddController(AuthenticatedRestController):
|
||||
def post(self, residence, member_uid, name, mac, go_redirect = True, plugin_action = None):
|
||||
residence_dn = Residences.get_dn_by_name(self.user, residence)
|
||||
member_base_dn = ldap_config.username_base_dn + residence_dn
|
||||
member = Member.get_by_uid(self.user, member_base_dn, member_uid)
|
||||
member = Member.get_by_uid(self.user, residence_dn, member_uid)
|
||||
|
||||
#Vérification que l'adresse mac soit correcte
|
||||
mac_match = re.match('^([0-9A-Fa-f]{2}[:-]?){5}([0-9A-Fa-f]{2})$', mac)
|
||||
|
@ -30,8 +30,8 @@ class Member(object):
|
||||
#end def
|
||||
|
||||
@staticmethod
|
||||
def get_by_uid(user_session, member_base_dn, uid):
|
||||
return user_session.ldap_bind.search_first(member_base_dn, "(uid=" + uid + ")")
|
||||
def get_by_uid(user_session, residence_dn, uid):
|
||||
return user_session.ldap_bind.search_first(ldap_config.username_base_dn + residence_dn, "(uid=" + uid + ")")
|
||||
#end def
|
||||
|
||||
@staticmethod
|
||||
|
Loading…
Reference in New Issue
Block a user