From 63734d49234dd0599a5551f37533601a807b2dd8 Mon Sep 17 00:00:00 2001 From: detraz Date: Sun, 14 Oct 2018 22:48:04 +0200 Subject: [PATCH] Fix bug dans le model mac, renvoie une liste de mac uniques --- users/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/users/models.py b/users/models.py index 41954e62..fcaaeed4 100755 --- a/users/models.py +++ b/users/models.py @@ -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