From d17e71c53c98c3ee6eec236f9ef7419dbefbfc4b Mon Sep 17 00:00:00 2001 From: Grizzly Date: Sat, 8 Dec 2018 21:18:42 +0000 Subject: [PATCH 1/3] machines prise en compte pour l'ajout automatique --- users/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/models.py b/users/models.py index f1577a24..8703c978 100755 --- a/users/models.py +++ b/users/models.py @@ -695,7 +695,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""" - all_interfaces = self.user_interfaces(active=False) + all_interfaces = self.user_interfaces() if all_interfaces.count() > OptionalMachine.get_cached_value( 'max_lambdauser_interfaces' ): From ae5ef6a3c5643e79eeebb6e65b1558731d82ed94 Mon Sep 17 00:00:00 2001 From: Grizzly Date: Sat, 8 Dec 2018 22:20:31 +0000 Subject: [PATCH 2/3] =?UTF-8?q?Utilise=20l'acl=20pour=20la=20v=C3=A9rifica?= =?UTF-8?q?tion=20de=20la=20possibilit=C3=A9=20de=20cr=C3=A9ation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- users/models.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/users/models.py b/users/models.py index 8703c978..7d7b43d4 100755 --- a/users/models.py +++ b/users/models.py @@ -696,9 +696,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, """ Fonction appellée par freeradius. Enregistre la mac pour une machine inconnue sur le compte de l'user""" all_interfaces = self.user_interfaces() - if all_interfaces.count() > OptionalMachine.get_cached_value( - 'max_lambdauser_interfaces' - ): + if Machine.can_create(self): return False, _("Maximum number of registered machines reached.") if not nas_type: return False, _("Re2o doesn't know wich machine type to assign.") From c5b3f509551003762f76a2db65308e909d226594 Mon Sep 17 00:00:00 2001 From: Grizzly Date: Sat, 8 Dec 2018 22:52:08 +0000 Subject: [PATCH 3/3] Suppression de la ligne inutile --- users/models.py | 1 - 1 file changed, 1 deletion(-) diff --git a/users/models.py b/users/models.py index 7d7b43d4..a198cfb5 100755 --- a/users/models.py +++ b/users/models.py @@ -695,7 +695,6 @@ 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""" - all_interfaces = self.user_interfaces() if Machine.can_create(self): return False, _("Maximum number of registered machines reached.") if not nas_type: