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,