Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Apr 12, 2023
1 parent 74c4094 commit 61a4db3
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from pydantic import BaseModel, Extra, Field, NonNegativeInt
from servicelib.aiohttp.long_running_tasks.server import start_long_running_task
from servicelib.aiohttp.requests_validation import (
parse_request_body_as,
parse_request_path_parameters_as,
parse_request_query_parameters_as,
)
Expand All @@ -35,9 +36,10 @@
from ..security_decorators import permission_required
from ..users_api import get_user_name
from . import _create_utils, projects_api
from ._rest_schemas import ProjectUpdate
from .project_lock import get_project_locked_state
from .project_models import ProjectDict, ProjectTypeAPI
from .projects_db import APP_PROJECT_DBAPI, ProjectDBAPI
from .projects_db import ProjectDBAPI
from .projects_exceptions import (
ProjectDeleteError,
ProjectInvalidRightsError,
Expand Down Expand Up @@ -169,7 +171,7 @@ async def list_projects(request: web.Request):
"""

db: ProjectDBAPI = request.app[APP_PROJECT_DBAPI]
db: ProjectDBAPI = ProjectDBAPI.get_from_app_context(request.app)
req_ctx = RequestContext.parse_obj(request)
query_params = parse_request_query_parameters_as(_ProjectListParams, request)

Expand Down Expand Up @@ -357,7 +359,7 @@ async def replace_project(request: web.Request):
web.HTTPNotFound: This project was not found
"""

db: ProjectDBAPI = request.app[APP_PROJECT_DBAPI]
db: ProjectDBAPI = ProjectDBAPI.get_from_app_context(request.app)
req_ctx = RequestContext.parse_obj(request)
path_params = parse_request_path_parameters_as(ProjectPathParams, request)

Expand Down Expand Up @@ -472,9 +474,15 @@ async def replace_project(request: web.Request):
@permission_required("project.update")
@permission_required("services.pipeline.*")
async def update_project(request: web.Request):
db: ProjectDBAPI = request.app[APP_PROJECT_DBAPI]
db: ProjectDBAPI = ProjectDBAPI.get_from_app_context(request.app)
req_ctx = RequestContext.parse_obj(request)
path_params = parse_request_path_parameters_as(ProjectPathParams, request)
project_update = parse_request_body_as(ProjectUpdate, request)

assert db # nosec
assert req_ctx # nosec
assert path_params # nosec
assert project_update # nosec

raise NotImplementedError()

Expand Down

0 comments on commit 61a4db3

Please sign in to comment.