From 58ede006968d0390e2cc49becc83cdb581d434ca Mon Sep 17 00:00:00 2001 From: detraz Date: Mon, 31 Dec 2018 00:13:01 +0100 Subject: [PATCH] Hotfix autocreate --- users/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/users/models.py b/users/models.py index fe96df1e..e4c25956 100755 --- a/users/models.py +++ b/users/models.py @@ -696,7 +696,8 @@ 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""" - if Machine.can_create(self): + allowed, _message = Machine.can_create(self, self.id) + if not allowed: return False, _("Maximum number of registered machines reached.") if not nas_type: return False, _("Re2o doesn't know wich machine type to assign.")