Skip to content

Commit

Permalink
fix(user-management): Fix deleting user in hidden group(s)
Browse files Browse the repository at this point in the history
E.g. guest_users

Signed-off-by: Christoph Wurst <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
  • Loading branch information
ChristophWurst authored and nextcloud-command committed Feb 10, 2023
1 parent fdb5a66 commit 1cae916
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions apps/settings/src/store/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ const mutations = {
state.userCount-- // decrement Active Users count
user.groups.forEach(userGroup => {
const group = state.groups.find(groupSearch => groupSearch.id === userGroup)
if (!group) {
console.warn('User group ' + userGroup + ' does not exist during user removal')
return
}
group.usercount-- // decrement group total count
})
} else {
Expand Down
Loading

0 comments on commit 1cae916

Please sign in to comment.