Преглед изворни кода

解决获取设备地区天气频繁问题

peng пре 1 година
родитељ
комит
e038c69b5f
1 измењених фајлова са 2 додато и 0 уклоњено
  1. 2 0
      Controller/WeatherControl.py

+ 2 - 0
Controller/WeatherControl.py

@@ -53,6 +53,8 @@ class WeatherView(View):
             return response.json(173)
         redis_obj = RedisObject()
         city_id = uid_set_qs[0]['tb_city_information_id']
+        if city_id == 0:
+            return response.json(10, '请更新设备影子地区信息')
         today = datetime.datetime.today()
         now_time = datetime.datetime(today.year, today.month, today.day, today.hour)
         time_stamp = CommonService.str_to_timestamp(now_time.strftime('%Y-%m-%d %H:%M:%S'))