Skip to content

Commit

Permalink
Merge pull request #278 from hotosm/feat/update-completed-task
Browse files Browse the repository at this point in the history
fix: completed task status count
  • Loading branch information
Pradip-p authored Oct 9, 2024
2 parents dfb32d7 + dc612ee commit b421771
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/backend/app/projects/project_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,12 +547,13 @@ def calculate_status(cls, values):
"""Set the project status based on task counts."""
ongoing_task_count = values.ongoing_task_count
completed_task_count = values.completed_task_count
total_task_count = values.total_task_count

if ongoing_task_count == 0:
values.status = "not-started"
elif ongoing_task_count > 0 and ongoing_task_count != completed_task_count:
values.status = "ongoing"
elif ongoing_task_count == completed_task_count:
elif ongoing_task_count == total_task_count:
values.status = "completed"

return values
Expand Down

0 comments on commit b421771

Please sign in to comment.