mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-25 00:13:45 +00:00
Adpate l'autocapture au type de nas
This commit is contained in:
parent
04ea76c588
commit
93805aed15
1 changed files with 3 additions and 4 deletions
|
@ -455,15 +455,14 @@ class User(AbstractBaseUser):
|
||||||
general_options.email_from, [req.user.email], fail_silently=False)
|
general_options.email_from, [req.user.email], fail_silently=False)
|
||||||
return
|
return
|
||||||
|
|
||||||
def autoregister_machine(self, mac_address, nas_ip):
|
def autoregister_machine(self, mac_address, nas_type):
|
||||||
all_machines = self.all_machines()
|
all_machines = self.all_machines()
|
||||||
options, created = OptionalMachine.objects.get_or_create()
|
options, created = OptionalMachine.objects.get_or_create()
|
||||||
if all_machines.count() > options.max_lambdauser_interfaces:
|
if all_machines.count() > options.max_lambdauser_interfaces:
|
||||||
return False, "Maximum de machines enregistrees atteinte"
|
return False, "Maximum de machines enregistrees atteinte"
|
||||||
nas_object = Nas.objects.filter(nas_type__in=MachineType.objects.filter(ip_type=nas_ip.ip_type))
|
if not nas_type:
|
||||||
if not nas_object:
|
|
||||||
return False, "Re2o ne sait pas à quel machinetype affecter cette machine"
|
return False, "Re2o ne sait pas à quel machinetype affecter cette machine"
|
||||||
machine_type_cible = nas_object.first().machine_type
|
machine_type_cible = nas_type.machine_type
|
||||||
try:
|
try:
|
||||||
machine_parent = Machine()
|
machine_parent = Machine()
|
||||||
machine_parent.user = self
|
machine_parent.user = self
|
||||||
|
|
Loading…
Reference in a new issue