From 31ff16d22c9493589edd8b72a198ce16393361c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=89=8D=E6=98=8E?= <909355014@qq.com> Date: Wed, 21 Sep 2022 19:20:53 +0800 Subject: [PATCH] cache area break --- apps/am/tasks.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/am/tasks.py b/apps/am/tasks.py index 67374376..a2dd0b2a 100644 --- a/apps/am/tasks.py +++ b/apps/am/tasks.py @@ -12,10 +12,16 @@ def cache_areas_info(): 缓存区域信息 """ area_list = [] + is_ok = True for i in Area.objects.filter(is_hidden=False).exclude(third_info__xx_rail=None).order_by('number'): points = [] for item in i.third_info['xx_rail']['detail']['polygon']['points']: + if 'longitude' not in item: + is_ok = False + break points.append((item['longitude'], item['latitude'])) + if not is_ok: + break area_dict = { 'id': i.id, 'type': i.type,