Merge pull request #15564 from nextcloud/fix/noid/rephrase-unclear-error-msg
User management/subadmin: rephrase ambiguous error message
This commit is contained in:
commit
58658f1c78
|
@ -773,7 +773,7 @@ class UsersController extends AUserData {
|
||||||
|
|
||||||
if (count($userSubAdminGroups) <= 1) {
|
if (count($userSubAdminGroups) <= 1) {
|
||||||
// Subadmin must not be able to remove a user from all their subadmin groups.
|
// Subadmin must not be able to remove a user from all their subadmin groups.
|
||||||
throw new OCSException('Cannot remove user from this group as this is the only remaining group you are a SubAdmin of', 105);
|
throw new OCSException('Not viable to remove user from the last group you are SubAdmin of', 105);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2516,7 +2516,7 @@ class UsersControllerTest extends TestCase {
|
||||||
/**
|
/**
|
||||||
* @expectedException \OCP\AppFramework\OCS\OCSException
|
* @expectedException \OCP\AppFramework\OCS\OCSException
|
||||||
* @expectedExceptionCode 105
|
* @expectedExceptionCode 105
|
||||||
* @expectedExceptionMessage Cannot remove user from this group as this is the only remaining group you are a SubAdmin of
|
* @expectedExceptionMessage Not viable to remove user from the last group you are SubAdmin of
|
||||||
*/
|
*/
|
||||||
public function testRemoveFromGroupAsSubAdminFromLastSubAdminGroup() {
|
public function testRemoveFromGroupAsSubAdminFromLastSubAdminGroup() {
|
||||||
$loggedInUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
|
$loggedInUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
|
||||||
|
|
Loading…
Reference in New Issue