Просмотр исходного кода

修改一个时区传空异常问题

pengzhibo168 5 лет назад
Родитель
Сommit
82844eaaa4
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      Controller/DetectController.py

+ 4 - 0
Controller/DetectController.py

@@ -170,6 +170,10 @@ class DetectControllerView(View):
         lang = request_dict.get('lang', 'en')
         tz = request_dict.get('tz', '0')
         # 消息提醒功能新增
+
+        # 如果传空上来,就默认为0
+        if tz=='':
+            tz=0
         detect_group = request_dict.get('detect_group', None)
         interval = request_dict.get('interval', None)
         if not status: