Sort members higher up
This commit is contained in:
parent
9c38de3b3c
commit
5523d97504
|
@ -64,7 +64,6 @@ class Group:
|
|||
# to_dict() is usually called for display purposes, so get some more
|
||||
# information to display
|
||||
data['members'] = self.ldap_srv.get_display_info_for_users(self.members)
|
||||
data['members'].sort(key=lambda member: member['uid'])
|
||||
return data
|
||||
|
||||
def add_to_ldap(self):
|
||||
|
|
|
@ -112,7 +112,7 @@ class LDAPService:
|
|||
filter = '(|' + ''.join([f'(uid={uid})' for uid in usernames]) + ')'
|
||||
attributes = ['uid', 'cn', 'program']
|
||||
conn.search(self.ldap_users_base, filter, attributes=attributes)
|
||||
return [
|
||||
entries = [
|
||||
{
|
||||
'uid': entry.uid.value,
|
||||
'cn': entry.cn.value,
|
||||
|
@ -120,6 +120,8 @@ class LDAPService:
|
|||
}
|
||||
for entry in conn.entries
|
||||
]
|
||||
entries.sort(key=lambda member: member['uid'])
|
||||
return entries
|
||||
|
||||
def get_users_with_positions(self) -> List[IUser]:
|
||||
conn = self._get_ldap_conn()
|
||||
|
|
Loading…
Reference in New Issue