From 5ece3bdd1b7900191c81de58f2a39a8c8aad1828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Sun, 29 Dec 2024 21:39:54 +0100 Subject: [PATCH] fix load_group_continue --- src/c3nav/mapdata/api/map.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/c3nav/mapdata/api/map.py b/src/c3nav/mapdata/api/map.py index 983dd451..69c1fdef 100644 --- a/src/c3nav/mapdata/api/map.py +++ b/src/c3nav/mapdata/api/map.py @@ -461,30 +461,30 @@ def get_load(request): beacons_by_space.setdefault(beacon.space_id, {})[beacon.pk] = beacon locationgroups_contribute_to = dict( - LocationGroup.objects.filter(load_contribute_to__isnull=False).values_list("pk", "load_contribute_to") + LocationGroup.objects.filter(load_group_continue__isnull=False).values_list("pk", "load_group_continue") ) - for area in Area.objects.filter((Q(load_contribute_to__isnull=False) + for area in Area.objects.filter((Q(load_group_continue__isnull=False) | Q(groups__in=locationgroups_contribute_to.keys()))).prefetch_related("groups"): contribute_to = set() - if area.load_contribute_to_id: - contribute_to.add(area.load_contribute_to_id) + if area.load_group_continue_id: + contribute_to.add(area.load_group_continue_id) for group in area.groups.all(): - if group.load_contribute_to_id: - contribute_to.add(group.load_contribute_to_id) + if group.load_group_continue_id: + contribute_to.add(group.load_group_continue_id) for beacon in beacons_by_space.get(area.space_id, {}).values(): if area.geometry.intersects(unwrap_geom(beacon.geometry)): for load_group_id in contribute_to: max_values[load_group_id] += beacon.max_observed_num_clients current_values[load_group_id] += beacon.num_clients - for space in Space.objects.filter((Q(load_contribute_to__isnull=False) + for space in Space.objects.filter((Q(load_group_continue__isnull=False) | Q(groups__in=locationgroups_contribute_to.keys()))).prefetch_related("groups"): contribute_to = set() - if space.load_contribute_to_id: - contribute_to.add(space.load_contribute_to_id) + if space.load_group_continue_id: + contribute_to.add(space.load_group_continue_id) for group in space.groups.all(): - if group.load_contribute_to_id: - contribute_to.add(group.load_contribute_to_id) + if group.load_group_continue_id: + contribute_to.add(group.load_group_continue_id) for beacon in beacons_by_space.get(space.pk, {}).values(): for load_group_id in contribute_to: max_values[load_group_id] += beacon.max_observed_num_clients