user-groups: Update user_group_name_dict, when name/description is edited.

We do not update user_group_name_dict when name or description is edited,
which may lead to errors if get_user_group_from_name is called, so to fix
that we update user_group_name_dict also.
This commit is contained in:
Tarun Kumar 2018-03-15 20:18:48 +05:30 committed by Tim Abbott
parent 5c1858e584
commit dafaf28099
1 changed files with 4 additions and 0 deletions

View File

@ -39,9 +39,13 @@ exports.update = function (event) {
var group = exports.get_user_group_from_id(event.group_id); var group = exports.get_user_group_from_id(event.group_id);
if (event.data.name !== undefined) { if (event.data.name !== undefined) {
group.name = event.data.name; group.name = event.data.name;
user_group_name_dict.del(group.name);
user_group_name_dict.set(group.name, group);
} }
if (event.data.description !== undefined) { if (event.data.description !== undefined) {
group.description = event.data.description; group.description = event.data.description;
user_group_name_dict.del(group.name);
user_group_name_dict.set(group.name, group);
} }
}; };