Skip to content

Commit

Permalink
refactor: remove final ref to convert_app_tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Nov 28, 2023
1 parent cd4e426 commit ce61879
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/backend/app/projects/project_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,7 @@ async def get_dbqrcode_from_file(zip, qr_filename: str, error_detail: str):


async def convert_to_app_project(db_project: db_models.DbProject):
# TODO refactor login to Pydantic models
if not db_project:
log.debug("convert_to_app_project called, but no project provided")
return None
Expand All @@ -1918,12 +1919,11 @@ async def convert_to_app_project(db_project: db_models.DbProject):
db_project.outline, {"id": db_project.id}, db_project.id
)

app_project.project_tasks = await tasks_crud.convert_to_app_tasks(db_project.tasks)

return app_project


async def convert_to_app_project_info(db_project_info: db_models.DbProjectInfo):
# TODO refactor login to Pydantic models
if db_project_info:
app_project_info: project_schemas.ProjectInfo = db_project_info
return app_project_info
Expand All @@ -1934,6 +1934,7 @@ async def convert_to_app_project_info(db_project_info: db_models.DbProjectInfo):
async def convert_to_app_projects(
db_projects: List[db_models.DbProject],
) -> List[project_schemas.ProjectOut]:
# TODO refactor login to Pydantic models
if db_projects and len(db_projects) > 0:

async def convert_project(project):
Expand All @@ -1948,6 +1949,7 @@ async def convert_project(project):


async def convert_to_project_summary(db_project: db_models.DbProject):
# TODO refactor login to Pydantic models
if db_project:
summary: project_schemas.ProjectSummary = db_project

Expand All @@ -1971,6 +1973,7 @@ async def convert_to_project_summary(db_project: db_models.DbProject):
async def convert_to_project_summaries(
db_projects: List[db_models.DbProject],
) -> List[project_schemas.ProjectSummary]:
# TODO refactor login to Pydantic models
if db_projects and len(db_projects) > 0:

async def convert_summary(project):
Expand All @@ -1985,6 +1988,7 @@ async def convert_summary(project):


async def convert_to_project_feature(db_project_feature: db_models.DbFeatures):
# TODO refactor login to Pydantic models
if db_project_feature:
app_project_feature: project_schemas.Feature = db_project_feature

Expand All @@ -2003,6 +2007,7 @@ async def convert_to_project_feature(db_project_feature: db_models.DbFeatures):
async def convert_to_project_features(
db_project_features: List[db_models.DbFeatures],
) -> List[project_schemas.Feature]:
# TODO refactor login to Pydantic models
if db_project_features and len(db_project_features) > 0:

async def convert_feature(project_feature):
Expand Down

0 comments on commit ce61879

Please sign in to comment.