Explorar o código

传感器复位删除传感器记录

locky hai 1 ano
pai
achega
f8e0258fdc
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      Controller/SensorGateway/SubDeviceController.py

+ 1 - 0
Controller/SensorGateway/SubDeviceController.py

@@ -636,6 +636,7 @@ class GatewaySubDeviceView(View):
                 with transaction.atomic():
                     SmartScene.objects.filter(sub_device_id=sub_device_id).delete()
                     SceneLog.objects.filter(sub_device_id=sub_device_id).delete()
+                    SensorRecord.objects.filter(gateway_sub_device_id=sub_device_id).delete()
                     gateway_sub_device_qs.delete()
             else:
                 GatewaySubDevice.objects.filter(ieee_addr=ieee_addr).update(status=online)