Skip to content

Commit 58658f1

Browse files
authored
Merge pull request #15564 from nextcloud/fix/noid/rephrase-unclear-error-msg
User management/subadmin: rephrase ambiguous error message
2 parents 633a198 + 45110f4 commit 58658f1

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

apps/provisioning_api/lib/Controller/UsersController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ public function removeFromGroup(string $userId, string $groupid): DataResponse {
773773

774774
if (count($userSubAdminGroups) <= 1) {
775775
// Subadmin must not be able to remove a user from all their subadmin groups.
776-
throw new OCSException('Cannot remove user from this group as this is the only remaining group you are a SubAdmin of', 105);
776+
throw new OCSException('Not viable to remove user from the last group you are SubAdmin of', 105);
777777
}
778778
}
779779

apps/provisioning_api/tests/Controller/UsersControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2516,7 +2516,7 @@ public function testRemoveFromGroupAsSubAdminFromSubAdmin() {
25162516
/**
25172517
* @expectedException \OCP\AppFramework\OCS\OCSException
25182518
* @expectedExceptionCode 105
2519-
* @expectedExceptionMessage Cannot remove user from this group as this is the only remaining group you are a SubAdmin of
2519+
* @expectedExceptionMessage Not viable to remove user from the last group you are SubAdmin of
25202520
*/
25212521
public function testRemoveFromGroupAsSubAdminFromLastSubAdminGroup() {
25222522
$loggedInUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();

0 commit comments

Comments
 (0)