Sort group member listing by WatIAM ID (#78)

Closes #74.

Co-authored-by: Jono <jowonowo@gmail.com>
Reviewed-on: #78
Reviewed-by: Raymond Li <raymo@csclub.uwaterloo.ca>
Co-authored-by: Jonathan Leung <j23leung@csclub.uwaterloo.ca>
Co-committed-by: Jonathan Leung <j23leung@csclub.uwaterloo.ca>
pull/82/head
Jonathan Leung 4 months ago committed by Raymond Li
parent 3b7c89c925
commit c30ca54752
  1. 4
      ceod/model/LDAPService.py

@ -112,14 +112,14 @@ 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 [
return sorted([
{
'uid': entry.uid.value,
'cn': entry.cn.value,
'program': entry.program.value or 'Unknown',
}
for entry in conn.entries
]
], key=lambda member: member['uid'])
def get_users_with_positions(self) -> List[IUser]:
conn = self._get_ldap_conn()

Loading…
Cancel
Save