diff --git a/src/backend/app/projects/project_crud.py b/src/backend/app/projects/project_crud.py index ac393b3c..2f54be17 100644 --- a/src/backend/app/projects/project_crud.py +++ b/src/backend/app/projects/project_crud.py @@ -10,6 +10,7 @@ from fmtm_splitter.splitter import split_by_square from fastapi.concurrency import run_in_threadpool from databases import Database +from app.models.enums import ProjectStatus async def create_project_with_project_info( @@ -51,8 +52,8 @@ async def create_project_with_project_info( "short_description": project_metadata.short_description, "description": project_metadata.description, "per_task_instructions": project_metadata.per_task_instructions, - "status": "DRAFT", - "visibility": "PUBLIC", + "status": ProjectStatus.DRAFT.name, + "visibility": project_metadata.visibility.name, "outline": str(project_metadata.outline), "no_fly_zones": str(project_metadata.no_fly_zones), "dem_url": project_metadata.dem_url, diff --git a/src/backend/app/projects/project_schemas.py b/src/backend/app/projects/project_schemas.py index 5e9a32cc..4cf72565 100644 --- a/src/backend/app/projects/project_schemas.py +++ b/src/backend/app/projects/project_schemas.py @@ -2,7 +2,7 @@ from pydantic import BaseModel, computed_field, Field from typing import Any, Optional, Union from geojson_pydantic import Feature, FeatureCollection, Polygon -from app.models.enums import TaskSplitType +from app.models.enums import ProjectVisibility from shapely import wkb from datetime import date @@ -33,8 +33,6 @@ class ProjectIn(BaseModel): short_description: str description: str per_task_instructions: Optional[str] = None - organisation_id: Optional[int] = None - task_split_type: Optional[TaskSplitType] = None task_split_dimension: Optional[int] = None dem_url: Optional[str] = None gsd_cm_px: float = None @@ -45,6 +43,7 @@ class ProjectIn(BaseModel): output_pointcloud_url: Optional[str] = None output_raw_url: Optional[str] = None deadline_at: Optional[date] = None + visibility: Optional[ProjectVisibility] = ProjectVisibility.PUBLIC @computed_field @property