summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2020-02-12 18:14:10 +0000
committerGitHub <noreply@github.com>2020-02-12 18:14:10 +0000
commitd8994942f28f5028e560f6aba52512fae3ca1a6a (patch)
tree7f2dcaab240436d3d0850fac778787469b6388c9 /synapse/rest
parentMerge branch 'master' into develop (diff)
downloadsynapse-d8994942f28f5028e560f6aba52512fae3ca1a6a.tar.xz
Return a 404 for admin api user lookup if user not found (#6901)
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/admin/users.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/rest/admin/users.py b/synapse/rest/admin/users.py
index e75c5f1370..2107b5dc56 100644
--- a/synapse/rest/admin/users.py
+++ b/synapse/rest/admin/users.py
@@ -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):