Return a 404 for admin api user lookup if user not found (#6901)

This commit is contained in:
Andrew Morgan 2020-02-12 18:14:10 +00:00 committed by GitHub
parent 47acbc519f
commit d8994942f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 1 deletions

View file

@ -21,7 +21,7 @@ from six import text_type
from six.moves import http_client
from synapse.api.constants import UserTypes
from synapse.api.errors import Codes, SynapseError
from synapse.api.errors import Codes, NotFoundError, SynapseError
from synapse.http.servlet import (
RestServlet,
assert_params_in_dict,
@ -152,6 +152,9 @@ class UserRestServletV2(RestServlet):
ret = await self.admin_handler.get_user(target_user)
if not ret:
raise NotFoundError("User not found")
return 200, ret
async def on_PUT(self, request, user_id):