8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-26 06:32:26 +00:00

Merge branch 'fix_mac_uniq' into 'dev'

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

See merge request federez/re2o!336
This commit is contained in:
chirac 2018-10-14 22:54:16 +02:00
commit f803326e44

View file

@ -609,9 +609,9 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser,
if access_refresh: if access_refresh:
user_ldap.dialupAccess = str(self.has_access()) user_ldap.dialupAccess = str(self.has_access())
if mac_refresh: 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 machine__user=self
).values_list('mac_address', flat=True).distinct()] ).values_list('mac_address', flat=True).distinct()])
if group_refresh: if group_refresh:
# Need to refresh all groups because we don't know which groups # Need to refresh all groups because we don't know which groups
# were updated during edition of groups and the user may no longer # were updated during edition of groups and the user may no longer