Skip to content
Snippets Groups Projects
Commit a20f7f1d authored by Victor Dubiniuk's avatar Victor Dubiniuk
Browse files

Do not add groups if user has no groups

parent 33e1ced5
No related branches found
No related tags found
No related merge requests found
......@@ -449,8 +449,10 @@ $(document).ready(function () {
OC.dialogs.alert(result.data.message,
t('settings', 'Error creating user'));
} else {
var addedGroups = result.data.groups.split(', ');
UserList.availableGroups = $.unique($.merge(UserList.availableGroups, addedGroups));
if (result.data.groups) {
var addedGroups = result.data.groups.split(', ');
UserList.availableGroups = $.unique($.merge(UserList.availableGroups, addedGroups));
}
if($('tr[data-uid="' + username + '"]').length === 0) {
UserList.add(username, username, result.data.groups, null, 'default', true);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment