mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Fix exception with endpoints returning HTTP status code 204. Fixes #1891
This commit is contained in:
1 parent
36b9f8bdfd
commit
ce55ec73a4
29 files changed
+337
-192
No files matched your search
@@ -25,7 +25,7 @@ import logging
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
from fastapi import APIRouter, Request, Response, HTTPException, Depends, status
|
||||
from fastapi import APIRouter, Request, Response, HTTPException, Depends, Response, status
|
||||
from typing import List
|
||||
from uuid import UUID
|
||||
|
||||
@@ -102,13 +102,14 @@ async def delete_template(
|
||||
template_id: UUID,
|
||||
templates_repo: TemplatesRepository = Depends(get_repository(TemplatesRepository)),
|
||||
rbac_repo: RbacRepository = Depends(get_repository(RbacRepository))
|
||||
) -> None:
|
||||
) -> Response:
|
||||
"""
|
||||
Delete a template.
|
||||
"""
|
||||
|
||||
await TemplatesService(templates_repo).delete_template(template_id)
|
||||
await rbac_repo.delete_all_permissions_with_path(f"/templates/{template_id}")
|
||||
return Response(status_code=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
@router.get("/templates", response_model=List[schemas.Template], response_model_exclude_unset=True)
|
||||
|
||||
Reference in new issue
Block a user