mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 11:23:10 +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):
|
||||
""" 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)
|
||||
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.")
|
||||
|
|
Loading…
Reference in a new issue