From c66b492f8f8485a9a172def5ce0b16ffff5ad569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Fri, 26 May 2017 20:30:06 +0200 Subject: [PATCH] rename empty string level in editor api --- src/c3nav/editor/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/c3nav/editor/api.py b/src/c3nav/editor/api.py index b7bb3e38..885a7493 100644 --- a/src/c3nav/editor/api.py +++ b/src/c3nav/editor/api.py @@ -29,10 +29,10 @@ class EditorViewSet(ViewSet): holes_geom = cascaded_union([hole.geometry for hole in holes]) buildings = section.buildings.all() spaces = section.spaces.all() - spaces_geom = cascaded_union([space.geometry for space in spaces if space.level == '']) + spaces_geom = cascaded_union([space.geometry for space in spaces if space.level == 'normal']) holes_geom = holes_geom.intersection(spaces_geom) doors = section.doors.all() - for obj in chain(buildings, (s for s in spaces if s.level == '')): + for obj in chain(buildings, (s for s in spaces if s.level == 'normal')): obj.geometry = obj.geometry.difference(holes_geom) results = [] @@ -58,7 +58,7 @@ class EditorViewSet(ViewSet): doors = [door for door in section.doors.all() if door.geometry.intersects(space.geometry)] doors_geom = cascaded_union([door.geometry for door in doors]) - spaces = [s for s in section.spaces.filter(level='') + spaces = [s for s in section.spaces.filter(level='normal') if s.geometry.intersects(doors_geom) and s.pk != space.pk] results = chain(