mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-18 18:49:23 -04:00
Convert status codes to HTTPStatus
in synapse.rest.admin
(#11452)
This commit is contained in:
parent
fb58611d21
commit
e8ae94a223
12 changed files with 276 additions and 171 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue