mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-27 07:02:26 +00:00
Merge branch 'limit_machine' into 'dev'
machines prise en compte pour l'ajout automatique See merge request federez/re2o!361
This commit is contained in:
commit
ab52279e20
1 changed files with 1 additions and 4 deletions
|
@ -695,10 +695,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser,
|
||||||
def autoregister_machine(self, mac_address, nas_type):
|
def autoregister_machine(self, mac_address, nas_type):
|
||||||
""" Fonction appellée par freeradius. Enregistre la mac pour
|
""" Fonction appellée par freeradius. Enregistre la mac pour
|
||||||
une machine inconnue sur le compte de l'user"""
|
une machine inconnue sur le compte de l'user"""
|
||||||
all_interfaces = self.user_interfaces(active=False)
|
if Machine.can_create(self):
|
||||||
if all_interfaces.count() > OptionalMachine.get_cached_value(
|
|
||||||
'max_lambdauser_interfaces'
|
|
||||||
):
|
|
||||||
return False, _("Maximum number of registered machines reached.")
|
return False, _("Maximum number of registered machines reached.")
|
||||||
if not nas_type:
|
if not nas_type:
|
||||||
return False, _("Re2o doesn't know wich machine type to assign.")
|
return False, _("Re2o doesn't know wich machine type to assign.")
|
||||||
|
|
Loading…
Reference in a new issue