summary refs log tree commit diff
path: root/synapse/rest/admin/groups.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/groups.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/groups.py')
-rw-r--r--synapse/rest/admin/groups.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/rest/admin/groups.py b/synapse/rest/admin/groups.py
index 68a3ba3cb7..a27110388f 100644
--- a/synapse/rest/admin/groups.py
+++ b/synapse/rest/admin/groups.py
@@ -12,6 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 import logging
+from http import HTTPStatus
 from typing import TYPE_CHECKING, Tuple
 
 from synapse.api.errors import SynapseError
@@ -43,7 +44,7 @@ class DeleteGroupAdminRestServlet(RestServlet):
         await assert_user_is_admin(self.auth, requester.user)
 
         if not self.is_mine_id(group_id):
-            raise SynapseError(400, "Can only delete local groups")
+            raise SynapseError(HTTPStatus.BAD_REQUEST, "Can only delete local groups")
 
         await self.group_server.delete_group(group_id, requester.user.to_string())
-        return 200, {}
+        return HTTPStatus.OK, {}