Skip to content

Commit

Permalink
refactor: get_tasks_list --> get_task_id_list rename
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Dec 11, 2023
1 parent 683643e commit 6a44083
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/backend/app/projects/project_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -1371,8 +1371,8 @@ def generate_appuser_files(

# Generating QR Code, XForm and uploading OSM Extracts to the form.
# Creating app users and updating the role of that user.
get_task_lists_sync = async_to_sync(tasks_crud.get_task_lists)
task_list = get_task_lists_sync(db, project_id)
get_task_id_list_sync = async_to_sync(tasks_crud.get_task_id_list)
task_list = get_task_id_list_sync(db, project_id)

# Run with expensive task via threadpool
def wrap_generate_task_files(task):
Expand Down Expand Up @@ -2024,7 +2024,7 @@ async def update_project_form(
db.add(db_feature)
db.commit()

tasks_list = await tasks_crud.get_task_lists(db, project_id)
tasks_list = await tasks_crud.get_task_id_list(db, project_id)

for task in tasks_list:
task_obj = await tasks_crud.get_task(db, task)
Expand Down
4 changes: 2 additions & 2 deletions src/backend/app/submission/submission_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,8 @@ def get_all_submissions(db: Session, project_id):

project = get_odk_project(odk_credentials)

get_task_lists_sync = async_to_sync(get_task_lists)
task_lists = get_task_lists_sync(db, project_id)
get_task_id_list_sync = async_to_sync(get_task_id_list)
task_lists = get_task_id_list_sync(db, project_id)
submissions = project.getAllSubmissions(project_info.odkid, task_lists)
return submissions

Expand Down
4 changes: 2 additions & 2 deletions src/backend/app/tasks/tasks_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ async def get_task_count_in_project(db: Session, project_id: int):
return result.fetchone()[0]


async def get_task_lists(db: Session, project_id: int):
"""Get a list of tasks for a project."""
async def get_task_id_list(db: Session, project_id: int) -> list[int]:
"""Get a list of tasks id for a project."""
query = text(
"""
SELECT id
Expand Down

0 comments on commit 6a44083

Please sign in to comment.