dever před 6 roky
rodič
revize
531dc31799
1 změnil soubory, kde provedl 6 přidání a 5 odebrání
  1. 6 5
      admin/page/device.py

+ 6 - 5
admin/page/device.py

@@ -141,11 +141,12 @@ class info_path(Load):
 					type_info = device_type[value['type_id']]
 					if type_info:
 						self.data['list'][key]['type'] = type_info['name']
-				info = gateway[value['gateway_id']]
-				if info:
-					self.data['list'][key]['gateway'] = info['name']
-				else:
-					self.data['list'][key]['gateway'] = '无'
+				self.data['list'][key]['gateway'] = '无'
+				if value['gateway_id'] in gateway:
+					info = gateway[value['gateway_id']]
+					if info:
+						self.data['list'][key]['gateway'] = info['name']
+					
 				if value['status']:
 					self.data['list'][key]['status'] = '已连接'
 				else: