no need to explicitly serialize the grid

This commit is contained in:
Laura Klünder 2024-12-04 12:20:27 +01:00
parent 05890de06a
commit 07a3c5ffa9
3 changed files with 3 additions and 11 deletions

View file

@ -50,7 +50,7 @@ def map_settings(request):
return MapSettingsSchema(
initial_bounds=initial_bounds,
initial_level=settings.INITIAL_LEVEL or None,
grid=grid.serialize().model_dump() if grid else None,
grid=grid if grid else None,
tile_server=settings.TILE_CACHE_SERVER,
)

View file

@ -50,14 +50,6 @@ class Grid(AbstractGrid):
else:
raise ValueError('column coordinates are not ordered')
def serialize(self) -> GridSchema:
return GridSchema(
rows=self.rows,
cols=self.cols,
invert_x=self.invert_y,
invert_y=self.invert_y,
)
def get_square_for_point(self, x, y):
x = bisect.bisect(self.cols, x)
if x <= 0 or x >= len(self.cols):