Ver código fonte

导入redis和常量类 设备型号版本

linhaohong 7 meses atrás
pai
commit
7fd241e764
1 arquivos alterados com 3 adições e 2 exclusões
  1. 3 2
      AdminController/DeviceManagementController.py

+ 3 - 2
AdminController/DeviceManagementController.py

@@ -1630,8 +1630,9 @@ class DeviceManagement(View):
         if not device_version_info_qs.exists():
             return response.json(174)
 
-        d_code = device_version_info_qs[0]['d_code']
-        software_ver = device_version_info_qs[0]['software_ver']
+        device_version_info = device_version_info_qs.first()  # Get the first instance
+        d_code = device_version_info.d_code
+        software_ver = device_version_info.software_ver
         version_key = RedisKeyConstant.ZOSI_DEVICE_VERSION_INFO.value + software_ver + d_code
         # 创建Redis对象
         redis = RedisObject()