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:
Lukas Reschke 2017-04-21 19:39:40 +02:00 committed by GitHub
commit 83ecf893d9
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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