Skip to content

Commit

Permalink
fix: task_id will be populated from form so it won't be null
Browse files Browse the repository at this point in the history
  • Loading branch information
Sujanadh committed Sep 10, 2024
1 parent 043bbe4 commit a15c0a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/backend/app/central/central_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,12 +796,11 @@ async def get_entities_data(
# Rename '__id' to 'id'
flattened_dict["id"] = flattened_dict.pop("__id")

# convert empty str task_id and osm_id to None
# when new entities are created task_id and osm_id will be empty
if "task_id" in flattened_dict and flattened_dict["task_id"] == "":
flattened_dict["task_id"] = None
# convert empty str osm_id to None
# when new entities are created osm_id will be empty
if "osm_id" in flattened_dict and flattened_dict["osm_id"] == "":
flattened_dict["osm_id"] = None

all_entities.append(flattened_dict)

return all_entities
Expand Down
2 changes: 1 addition & 1 deletion src/backend/app/central/central_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class EntityTaskID(BaseModel):
"""Map of Entity UUID to FMTM Task ID."""

id: str
task_id: Optional[int] = None
task_id: int


class EntityMappingStatus(EntityOsmID, EntityTaskID):
Expand Down

0 comments on commit a15c0a4

Please sign in to comment.