Merge pull request #4429 from nextcloud/proper-return-code-for-welcome-email
Use RESPOND_NOT_FOUND for non existing user
This commit is contained in:
commit
83ecf893d9
|
@ -790,7 +790,7 @@ class UsersController extends OCSController {
|
||||||
|
|
||||||
$targetUser = $this->userManager->get($userId);
|
$targetUser = $this->userManager->get($userId);
|
||||||
if($targetUser === null) {
|
if($targetUser === null) {
|
||||||
throw new OCSException('', \OCP\API::RESPOND_UNAUTHORISED);
|
throw new OCSException('', \OCP\API::RESPOND_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if admin / subadmin
|
// Check if admin / subadmin
|
||||||
|
|
|
@ -2707,7 +2707,7 @@ class UsersControllerTest extends TestCase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException \OCP\AppFramework\OCS\OCSException
|
* @expectedException \OCP\AppFramework\OCS\OCSException
|
||||||
* @expectedExceptionCode 997
|
* @expectedExceptionCode 998
|
||||||
*/
|
*/
|
||||||
public function testResendWelcomeMessageWithNotExistingTargetUser() {
|
public function testResendWelcomeMessageWithNotExistingTargetUser() {
|
||||||
$this->userManager
|
$this->userManager
|
||||||
|
|
Loading…
Reference in New Issue