Skip to content

Commit

Permalink
Merge pull request #289 from hotosm/fix/merge-conflict
Browse files Browse the repository at this point in the history
fix: merge conflict
  • Loading branch information
Pradip-p authored Oct 14, 2024
2 parents ed40275 + d959a81 commit 2c1274b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/backend/app/projects/project_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,12 +530,12 @@ def calculate_status(cls, values):
completed_task_count = values.completed_task_count
total_task_count = values.total_task_count

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

return values

Expand Down
4 changes: 4 additions & 0 deletions src/backend/app/tasks/task_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ async def get_task_stats(
raw_sql = """
SELECT
COUNT(CASE WHEN te.state = 'REQUEST_FOR_MAPPING' THEN 1 END) AS request_logs,
<<<<<<< HEAD
COUNT(CASE WHEN te.state IN ('LOCKED_FOR_MAPPING', 'REQUEST_FOR_MAPPING', 'IMAGE_UPLOADED', 'UNFLYABLE_TASK') THEN 1 END) AS ongoing_tasks,
=======
COUNT(CASE WHEN te.state = 'LOCKED_FOR_MAPPING' THEN 1 END) AS ongoing_tasks,
>>>>>>> 5e8a37ab505a3c4c12fa2a98348992c427652b61
COUNT(CASE WHEN te.state = 'IMAGE_PROCESSED' THEN 1 END) AS completed_tasks,
COUNT(CASE WHEN te.state = 'UNFLYABLE_TASK' THEN 1 END) AS unflyable_tasks
FROM (
Expand Down
25 changes: 25 additions & 0 deletions src/backend/pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2c1274b

Please sign in to comment.