settings: Fix user edit form not being shown.

Added an if condition to checks whether person is a bot before fetching
information about bot owner in *static/js/admin.js*.
This commit is contained in:
digi0ps
2017-03-21 18:04:45 +05:30
committed by Tim Abbott
parent 1dfac12c4b
commit a765b6e781

View File

@@ -917,16 +917,15 @@ function _setup_page() {
var owner_select = $(templates.render("bot_owner_select", {users_list: users_list}));
var admin_status = $('#administration-status').expectOne();
var person = people.get_person_from_user_id(user_id);
if (!person) {
return;
} else if (person.is_bot) {
// Dynamically add the owner select control in order to
// avoid performance issues in case of large number of users.
owner_select.val(bot_data.get(person.email).owner || "");
form_row.find(".edit_bot_owner_container").append(owner_select);
}
// Dynamically add the owner select control in order to
// avoid performance issues in case of large number of users.
owner_select.val(bot_data.get(person.email).owner || "");
form_row.find(".edit_bot_owner_container").append(owner_select);
// Show user form.
user_row.hide();
form_row.show();