cache area break

This commit is contained in:
曹前明 2022-09-21 19:20:53 +08:00
parent 8373f3c808
commit 31ff16d22c
1 changed files with 6 additions and 0 deletions

View File

@ -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,