소스 검색

修复ai更改状态时,没有勾选标签时,标签不变的错误

lang 3 년 전
부모
커밋
d628e63e75
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      Controller/AiController.py

+ 2 - 4
Controller/AiController.py

@@ -154,8 +154,7 @@ class AiView(View):
                 }
                 if interval:
                     qs_data['detect_interval'] = int(interval)
-                if detect_group:
-                    qs_data['detect_group'] = detect_group
+                    qs_data['detect_group'] = detect_group if detect_group else ''
                 uid_set_qs.update(**qs_data)
             else:
                 qs_data = {
@@ -165,8 +164,7 @@ class AiView(View):
                 }
                 if interval:
                     qs_data['detect_interval'] = int(interval)
-                if detect_group:
-                    qs_data['detect_group'] = detect_group
+                qs_data['detect_group'] = detect_group if detect_group else ''
                 # 添加设备配置
                 uid_set_qs = UidSetModel.objects.create(**qs_data)
                 uid_set_id = uid_set_qs.id