Skip to content

Commit

Permalink
fix: completed task status count
Browse files Browse the repository at this point in the history
  • Loading branch information
Pradip-p committed Oct 9, 2024
1 parent 4db4150 commit dc612ee
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 @@ -513,12 +513,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 dc612ee

Please sign in to comment.