8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 11:23:10 +00:00

Fix bug dans le model mac, renvoie une liste de mac uniques

This commit is contained in:
detraz 2018-10-14 22:48:04 +02:00 committed by chirac
parent ab06d4354e
commit 63734d4923

View file

@ -609,9 +609,9 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser,
if access_refresh:
user_ldap.dialupAccess = str(self.has_access())
if mac_refresh:
user_ldap.macs = [str(mac) for mac in Interface.objects.filter(
user_ldap.macs = sorted([str(mac) for mac in Interface.objects.filter(
machine__user=self
).values_list('mac_address', flat=True).distinct()]
).values_list('mac_address', flat=True).distinct()])
if group_refresh:
# Need to refresh all groups because we don't know which groups
# were updated during edition of groups and the user may no longer