浏览代码

修改消息提醒开启时配置为空的话设置默认值

zhangdongming 1 年之前
父节点
当前提交
daff011f2c
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      Controller/DetectControllerV2.py

+ 7 - 0
Controller/DetectControllerV2.py

@@ -177,6 +177,13 @@ class DetectControllerViewV2(View):
                 elif status == 1 and msg_data:
                     msg_data['appPush'] = 1
                     uid_set_data['msg_notify'] = msg_data
+                elif status == 1 and not msg_data:
+                    msg_data = {'appPush': 1,
+                                'pushTime': {'allDay': 1, 'repeat': 127, 'endTime': 0, 'timeZone': '+08.00',
+                                             'startTime': 0},
+                                'eventTypes': {'device': [51], 'aiCloud': 1}
+                                }
+                    uid_set_data['msg_notify'] = msg_data
                 uid_set_id = uid_set_qs[0].id
                 uid_set_data['updTime'] = nowTime
                 uid_set_qs.update(**uid_set_data)