Skip to content

Commit

Permalink
fix: authentication on delete projects api (#1042)
Browse files Browse the repository at this point in the history
* delete projects api made authenticated

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
nrjadkry and pre-commit-ci[bot] authored Dec 12, 2023
1 parent 20ed698 commit 77ad259
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/backend/app/projects/project_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
from shapely.ops import unary_union
from sqlalchemy.orm import Session

from app.auth.osm import AuthUser, login_required

from ..central import central_crud
from ..db import database, db_models
from ..models.enums import TILES_FORMATS, TILES_SOURCE
Expand Down Expand Up @@ -205,7 +207,11 @@ async def read_project(project_id: int, db: Session = Depends(database.get_db)):


@router.delete("/delete/{project_id}")
async def delete_project(project_id: int, db: Session = Depends(database.get_db)):
async def delete_project(
project_id: int,
db: Session = Depends(database.get_db),
user_data: AuthUser = Depends(login_required),
):
"""Delete a project from ODK Central and the local database."""
# FIXME: should check for error

Expand Down

0 comments on commit 77ad259

Please sign in to comment.