api: add id/text attributes api/users/ endpoint (#21385)

This commit is contained in:
Frédéric Péters 2018-01-24 10:35:04 +01:00
parent 62531037a4
commit 0893bec032
1 changed files with 3 additions and 0 deletions

View File

@ -615,6 +615,9 @@ class ApiUsersDirectory(Directory):
user_info['user_id'] = user.id
user_roles = [Role.get(x, ignore_errors=True) for x in user.roles or []]
user_info['user_roles'] = [x.get_json_export_dict() for x in user_roles if x]
# add attributes to be usable as datasource
user_info['id'] = user.id
user_info['text'] = user_info['user_display_name']
return user_info
limit = int(get_request().form.get('limit') or '0') or None