From d51f1e126d5799dff6ec7cf0d65bdaa629824555 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Mon, 14 Oct 2019 23:43:36 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Fix=20r=C3=A9ponses=20multiples,=20ne=20cra?= =?UTF-8?q?sh=20pas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- users/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/models.py b/users/models.py index 69348c17..a168eb51 100755 --- a/users/models.py +++ b/users/models.py @@ -768,7 +768,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, def autoregister_machine(self, mac_address, nas_type): """ Fonction appellée par freeradius. Enregistre la mac pour une machine inconnue sur le compte de l'user""" - allowed, _message = Machine.can_create(self, self.id) + allowed, _message, _rights = Machine.can_create(self, self.id) if not allowed: return False, _("Maximum number of registered machines reached.") if not nas_type: From 47e67c3a40143b298f3747caef8f27f60df4a2fc Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Mon, 14 Oct 2019 23:47:34 +0200 Subject: [PATCH 2/2] Retourne au moins l'interface principale du switch --- topologie/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/topologie/models.py b/topologie/models.py index 0ed4b9dd..093907df 100644 --- a/topologie/models.py +++ b/topologie/models.py @@ -307,7 +307,7 @@ class Switch(AclMixin, Machine): It must the the management interface for that device""" switch_iptype = OptionalTopologie.get_cached_value('switchs_ip_type') if switch_iptype: - return self.interface_set.filter(machine_type__ip_type=switch_iptype).first() + return self.interface_set.filter(machine_type__ip_type=switch_iptype).first() or self.interface_set.first() return self.interface_set.first() @cached_property