Skip to content

Commit

Permalink
Merge pull request #627 from hotosm/hotfixes
Browse files Browse the repository at this point in the history
fix: upload boundary, seek(0) used for in memory file
  • Loading branch information
nrjadkry authored Jul 24, 2023
2 parents 75d95c9 + 4311c55 commit 6d56545
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/backend/app/projects/project_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ async def upload_project_boundary(
raise HTTPException(status_code=400, detail="Provide a valid .geojson file")

# read entire file
await upload.seek(0)
content = await upload.read()
boundary = json.loads(content)

Expand Down Expand Up @@ -412,6 +413,7 @@ async def edit_project_boundary(
raise HTTPException(status_code=400, detail="Provide a valid .geojson file")

# read entire file
await upload.seek(0)
content = await upload.read()
boundary = json.loads(content)

Expand Down Expand Up @@ -641,6 +643,7 @@ async def preview_tasks(upload: UploadFile = File(...), dimension: int = Form(50
raise HTTPException(status_code=400, detail="Provide a valid .geojson file")

# read entire file
await upload.seek(0)
content = await upload.read()
boundary = json.loads(content)

Expand Down

0 comments on commit 6d56545

Please sign in to comment.