mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 14:34:47 -04:00
Return a 404 for admin api user lookup if user not found (#6901)
This commit is contained in:
parent
47acbc519f
commit
d8994942f2
3 changed files with 21 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue