Skip to content

Commit

Permalink
fix: update task activity endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
sujanadh committed Apr 1, 2024
1 parent 428bba6 commit 5d22a5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
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 @@ -415,8 +415,8 @@ async def count_validated_and_mapped_tasks(

# Populate cumulative_counts with counts from task_history
for result in task_history:
task_status = result.action_text.split()[5]
date_str = result.action_date.strftime("%m/%d")
task_status = (result.get("action_text")).split()[5]
date_str = (result.get("action_date")).strftime("%m/%d")
entry = next((entry for entry in results if entry["date"] == date_str), None)

if entry:
Expand Down
4 changes: 3 additions & 1 deletion src/backend/app/tasks/tasks_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ async def task_activity(
"""
end_date = datetime.now() - timedelta(days=days)
task_history = await tasks_crud.get_project_task_history(project_id, end_date, db)
task_history = await tasks_crud.get_project_task_history(
project_id, False, end_date, None, db
)

return await tasks_crud.count_validated_and_mapped_tasks(
task_history,
Expand Down

0 comments on commit 5d22a5f

Please sign in to comment.