Skip to content

Commit

Permalink
Merge pull request #816 from hotosm/feat-UpdateProjectInfo
Browse files Browse the repository at this point in the history
fix: raw sql query in tasks feature
  • Loading branch information
nrjadkry authored Sep 7, 2023
2 parents 953818f + 22f710a commit d84770f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/backend/app/tasks/tasks_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,17 @@ async def task_features_count(
# Assemble the final data list
data = []
for x in odk_details:
feature_count_query = f"""
feature_count_query = text(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()

data.append({
'task_id': x['xmlFormId'],
'submission_count': x['submissions'],
'last_submission': x['lastSubmission'],
'feature_count': feature_count['count']
'feature_count': feature_count[0]
})

return data

0 comments on commit d84770f

Please sign in to comment.