Commit 473ae3af authored by Gabriel Detraz's avatar Gabriel Detraz Committed by root

Fix et optimise la collecte d'adresse mac pour ldap

parent cbdcdd6d
......@@ -576,10 +576,10 @@ class User(AbstractBaseUser):
if access_refresh:
user_ldap.dialupAccess = str(self.has_access())
if mac_refresh:
user_ldap.macs = [inter.mac_bare() for inter in
Interface.objects.filter(
machine__in=Machine.objects.filter(user=self)
)]
user_ldap.macs = [str(mac) for mac in Interface.objects.filter(
machine__user=self
).values_list('mac_address', flat=True).distinct()]
user_ldap.save()
def ldap_del(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment