summary refs log tree commit diff
path: root/synapse/rest/admin/_base.py
diff options
context:
space:
mode:
authorDirk Klimpel <5740567+dklimpel@users.noreply.github.com>2021-11-29 23:19:45 +0100
committerGitHub <noreply@github.com>2021-11-29 22:19:45 +0000
commite8ae94a22367a81049582dfdb16c743a45ca4e8b (patch)
tree79953e11bf825844817cfdf0423d2eb09045bac4 /synapse/rest/admin/_base.py
parentRefactor `backfilled` into specific behavior function arguments (`_persist_ev... (diff)
downloadsynapse-e8ae94a22367a81049582dfdb16c743a45ca4e8b.tar.xz
Convert status codes to `HTTPStatus` in `synapse.rest.admin` (#11452)
Diffstat (limited to 'synapse/rest/admin/_base.py')
-rw-r--r--synapse/rest/admin/_base.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/rest/admin/_base.py b/synapse/rest/admin/_base.py
index d9a2f6ca15..399b205aaf 100644
--- a/synapse/rest/admin/_base.py
+++ b/synapse/rest/admin/_base.py
@@ -13,6 +13,7 @@
 # limitations under the License.
 
 import re
+from http import HTTPStatus
 from typing import Iterable, Pattern
 
 from synapse.api.auth import Auth
@@ -62,4 +63,4 @@ async def assert_user_is_admin(auth: Auth, user_id: UserID) -> None:
     """
     is_admin = await auth.is_server_admin(user_id)
     if not is_admin:
-        raise AuthError(403, "You are not a server admin")
+        raise AuthError(HTTPStatus.FORBIDDEN, "You are not a server admin")