浏览代码

编辑广告时增加设备筛选过滤

linhaohong 1 年之前
父节点
当前提交
7a1f10e9d7
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      AdminController/CampaignController.py

+ 6 - 0
AdminController/CampaignController.py

@@ -315,6 +315,12 @@ class CampaignView(View):
                                                         "OpenScreenAdvertise")[0]
                 campaign.pad_image_url = pad_image_url
 
+            # 不包含设备和包含设备不能重复
+            if device_type_names and ex_device_type_names:
+                intersection = list(set(device_type_names).intersection(set(ex_device_type_names)))
+                if intersection:
+                    return response.json(10, "设备包含和设备不包含不能重复")
+
             # 更改轮播广告图片
             if banner_files:
                 for sort in sort_files: