Skip to content

Commit

Permalink
fix: raw sql query in tasks feature
Browse files Browse the repository at this point in the history
  • Loading branch information
nrjadkry committed Sep 7, 2023
1 parent c703c78 commit 22f710a
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 22f710a

Please sign in to comment.