Commit 673b775e authored by Daniel Stan's avatar Daniel Stan

auth.py: fix crash si chambre Inconnue

parent 11a5c70b
......@@ -339,10 +339,13 @@ def decide_vlan(data, is_wifi, conn):
else:
decision = 'adherent', u''
prise, chbre = get_prise_chbre(data)
port = "%s/%s" % (prise, chbre)
port = "%s/%s" % (prise, chbre or 'Inconnue')
chbre = escape_ldap(chbre)
hebergeurs = conn.search(u'(&(chbre=%s)(|(cid=*)(aid=*)))' % chbre)
if chbre:
chbre = escape_ldap(chbre)
hebergeurs = conn.search(u'(&(chbre=%s)(|(cid=*)(aid=*)))' % chbre)
else:
hebergeurs = []
# Prend la première machine candidat dans la base, ou exit
items = get_machines(data, is_wifi=is_wifi, proprio=(hebergeurs+[None])[0])
......
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