Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 7, 2023
1 parent 98a0eb2 commit 0a2270b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/backend/app/projects/project_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -1664,7 +1664,7 @@ def get_task_geometry(db: Session, project_id: int):
Returns:
str: A geojson of the task boundaries
"""
db_tasks =tasks_crud.get_tasks(db, project_id, None)
db_tasks = tasks_crud.get_tasks(db, project_id, None)
features = []
for task in db_tasks:
geom = to_shape(task.outline)
Expand All @@ -1673,7 +1673,7 @@ def get_task_geometry(db: Session, project_id: int):
properties = {
"task_id": task.id,
}
feature = {"type": "Feature", "geometry": geometry, "properties" :properties}
feature = {"type": "Feature", "geometry": geometry, "properties": properties}
features.append(feature)

feature_collection = {"type": "FeatureCollection", "features": features}
Expand All @@ -1682,10 +1682,10 @@ def get_task_geometry(db: Session, project_id: int):

async def get_project_features_geojson(db: Session, project_id: int):
db_tasks = (
db.query(db_models.DbFeatures)
.filter(db_models.DbFeatures.project_id == project_id)
.all()
)
db.query(db_models.DbFeatures)
.filter(db_models.DbFeatures.project_id == project_id)
.all()
)

"""Get a geojson of all features for a task."""
query = text(
Expand All @@ -1711,7 +1711,7 @@ async def get_project_features_geojson(db: Session, project_id: int):
for feature in features["features"]:
for task in db_tasks:
if task.id == feature["id"]:
feature["properties"]["task_id"]=task.task_id
feature["properties"]["task_id"] = task.task_id

return features

Expand Down

0 comments on commit 0a2270b

Please sign in to comment.