settings_users: Remove unnecessary sort.

The populate_users function doesn't need to sort the list of
active and non-active users, because the list_render is called
specifying to sort users by their full_name.

Author: Clara Moraes Dantas <clara.moraesd@gmail.com>
This commit is contained in:
Clara Dantas 2020-06-09 19:52:34 -03:00 committed by Tim Abbott
parent e95718f741
commit 6449366d64
1 changed files with 0 additions and 2 deletions

View File

@ -137,11 +137,9 @@ function failed_listing_users() {
function populate_users() { function populate_users() {
const active_user_ids = people.get_active_human_ids(); const active_user_ids = people.get_active_human_ids();
let active_users = active_user_ids.map(user_id => people.get_by_user_id(user_id)); let active_users = active_user_ids.map(user_id => people.get_by_user_id(user_id));
active_users = _.sortBy(active_users, 'full_name');
const deactivated_user_ids = people.get_non_active_human_ids(); const deactivated_user_ids = people.get_non_active_human_ids();
let deactivated_users = deactivated_user_ids.map(user_id => people.get_by_user_id(user_id)); let deactivated_users = deactivated_user_ids.map(user_id => people.get_by_user_id(user_id));
deactivated_users = _.sortBy(deactivated_users, 'full_name');
if (active_user_ids.length === 0 && deactivated_user_ids.length === 0) { if (active_user_ids.length === 0 && deactivated_user_ids.length === 0) {
failed_listing_users(); failed_listing_users();