mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-26 00:43:46 +00:00
FIx temporaires pour l'autodetect
This commit is contained in:
parent
350373a93d
commit
6ad7605bfe
2 changed files with 8 additions and 10 deletions
|
@ -284,11 +284,11 @@ def decide_vlan_and_register_macauth(switch_id, port_number, mac_address):
|
|||
elif not room_user.first().has_access():
|
||||
return (sw_name, 'Machine inconnue et adhérent non cotisant', VLAN_NOK)
|
||||
else:
|
||||
result, reason = user.autoregister_machine(mac_address)
|
||||
result, reason = room_user.first().autoregister_machine(mac_address, ipv4.first())
|
||||
if result:
|
||||
return (sw_name, 'Access Ok, Capture de la mac...', VLAN_OK)
|
||||
else:
|
||||
return (sw_name, u'Erreur dans le register mac %s' % reason, VLAN_NOK)
|
||||
return (sw_name, u'Erreur dans le register mac %s' % reason + unicode(mac_address), VLAN_NOK)
|
||||
elif not interface.first().is_active:
|
||||
return (sw_name, 'Machine non active / adherent non cotisant', VLAN_NOK)
|
||||
else:
|
||||
|
|
|
@ -474,14 +474,12 @@ class User(AbstractBaseUser):
|
|||
machine_parent.clean()
|
||||
domain = Domain()
|
||||
domain.name = self.pseudo.replace('_','-').lower() + str(all_machines.count())
|
||||
with transaction.atomic(), reversion.create_revision():
|
||||
machine_parent.save()
|
||||
interface_cible.machine = machine_parent
|
||||
interface_cible.save()
|
||||
domain.interface_parent = interface_cible
|
||||
domain.clean()
|
||||
domain.save()
|
||||
reversion.set_comment("Autocapture radius")
|
||||
machine_parent.save()
|
||||
interface_cible.machine = machine_parent
|
||||
interface_cible.save()
|
||||
domain.interface_parent = interface_cible
|
||||
domain.clean()
|
||||
domain.save()
|
||||
except Exception as e:
|
||||
return False, e
|
||||
return True, "Ok"
|
||||
|
|
Loading…
Reference in a new issue