Skip to content

Commit

Permalink
Merge pull request #906 from hotosm/fix-split-issue
Browse files Browse the repository at this point in the history
Fix task split issue
  • Loading branch information
nrjadkry authored Oct 12, 2023
2 parents ff26553 + e666f14 commit 39f512b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/backend/app/projects/project_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,10 @@ def update_multi_polygon_project_boundary(
return False

# Update the boundary polyon on the database.
polygons = boundary["features"]
if boundary["type"] == "Feature":
polygons = [boundary]
else:
polygons = boundary["features"]
log.debug(f"Processing {len(polygons)} task geometries")
for polygon in polygons:
# If the polygon is a MultiPolygon, convert it to a Polygon
Expand Down Expand Up @@ -769,7 +772,6 @@ def split_polygon_into_tasks(
)
return []

features = json.loads(features)
log.debug(f"Project {project_id} split into {len(features)} tasks")
return features

Expand Down

0 comments on commit 39f512b

Please sign in to comment.