mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 11:24:50 -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
|
@ -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, {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue