瀏覽代碼

已读/删除推送消息不判断设备是否属于用户

locky 1 年之前
父節點
當前提交
278971e327
共有 1 個文件被更改,包括 3 次插入11 次删除
  1. 3 11
      Controller/EquipmentInfo.py

+ 3 - 11
Controller/EquipmentInfo.py

@@ -196,12 +196,8 @@ class EquipmentInfo(View):
                         tab_val = int(ei_id[0:1])
                         ei_id = int(ei_id[1:])
                         eq = EquipmentInfoService.get_equipment_info_model('', tab_val)
-                        eq = eq.filter(id=ei_id)
-                        if eq.exists():
-                            own_dev = ModelService.check_own_device(userID, eq[0].device_uid)
-                            if own_dev is True:
-                                count += 1
-                                eq.update(status=1)
+                        eq.filter(id=ei_id).update(status=1)
+                        count += 1
 
                     except Exception as e:
                         print(repr(e))
@@ -239,11 +235,7 @@ class EquipmentInfo(View):
                     tab_val = int(ei_id[0:1])
                     ei_id = int(ei_id[1:])
                     eq = EquipmentInfoService.get_equipment_info_model('', tab_val)
-                    eq = eq.filter(id=ei_id)
-                    if eq.exists():
-                        own_dev = ModelService.check_own_device(userID, eq[0].device_uid)
-                        if own_dev is True:
-                            eq.delete()
+                    eq.filter(id=ei_id).delete()
 
             except Exception as e:
                 errorInfo = traceback.format_exc()