Skip to content

Commit

Permalink
updated task wise submission api for project info (#782)
Browse files Browse the repository at this point in the history
* updated task wise submission api for project info

* [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 Oct 9, 2023
1 parent bc03300 commit 874b226
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/backend/app/central/central_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ def delete_odk_xform(
return result


# def list_odk_xforms(project_id: int, odk_central: project_schemas.ODKCentral = None):
def list_odk_xforms(
project_id: int,
odk_central: project_schemas.ODKCentral = None,
Expand Down
7 changes: 3 additions & 4 deletions src/backend/app/tasks/tasks_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,10 @@ async def task_features_count(
# Assemble the final data list
data = []
for x in odk_details:
feature_count_query = text(
f"""
feature_count_query = f"""
select count(*) from features where project_id = {project_id} and task_id = {x['xmlFormId']}
"""
)

result = db.execute(feature_count_query)
feature_count = result.fetchone()

Expand All @@ -185,7 +184,7 @@ async def task_features_count(
"task_id": x["xmlFormId"],
"submission_count": x["submissions"],
"last_submission": x["lastSubmission"],
"feature_count": feature_count[0],
"feature_count": feature_count["count"],
}
)

Expand Down

0 comments on commit 874b226

Please sign in to comment.