浏览代码

fix a bug that didn't package data correctly

chenhaiyang 4 年之前
父节点
当前提交
b19642d810
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      app/controllers/targets/temperature.py

+ 2 - 1
app/controllers/targets/temperature.py

@@ -291,9 +291,10 @@ class TemperatureTargetPacker:
         all_day_targets = self.result['all_day_targets']
         if len(all_day_targets) > 0:
             extent = all_day_targets['temperatureMax'].iloc[0] - all_day_targets['temperatureMin'].iloc[0]
+            temperature_all_day_targets = all_day_targets[['temperatureMin', 'temperatureMax']].copy().to_dict()
         else:
             extent = 2.0
-        temperature_all_day_targets = all_day_targets[['temperatureMin', 'temperatureMax']].copy().to_dict()
+            temperature_all_day_targets = {}
         target_params = {
             'is_customized': self.result['is_customized'],
             'is_temporary': self.result['is_temporary'],