Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
george-silva committed Apr 30, 2024
1 parent 016c656 commit 4605090
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/planscape/planning/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def to_multipolygon(geometry: GEOSGeometry) -> GEOSGeometry:


def from_geojson(geometry: Union[Dict[str, Any] | GEOSGeometry]) -> GEOSGeometry:

if isinstance(geometry, GEOSGeometry):
return geometry

Expand Down
8 changes: 6 additions & 2 deletions src/planscape/planning/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,17 @@ def create_planning_area(request: Request) -> Response:
)
return Response(serializer.data)
except ValueError as ve:
logger.error("Invalid geometry while creating a new planning area. Payload has more than one feature.")
logger.error(
"Invalid geometry while creating a new planning area. Payload has more than one feature."
)
return Response(
{"message": f"Error creating planning area: {str(ve)}"},
status=status.HTTP_400_BAD_REQUEST,
)
except InvalidGeometry as ve:
logger.error("Invalid geometry while creating a new planning area. Geometry is invalid for some reason.")
logger.error(
"Invalid geometry while creating a new planning area. Geometry is invalid for some reason."
)
return Response(
{"message": f"Error creating planning area: {str(ve)}"},
status=status.HTTP_400_BAD_REQUEST,
Expand Down

0 comments on commit 4605090

Please sign in to comment.