Explorar o código

修改批量添加设备异常

zhangdongming %!s(int64=2) %!d(string=hai) anos
pai
achega
d521efcb23
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      Controller/EquipmentManagerV3.py

+ 2 - 1
Controller/EquipmentManagerV3.py

@@ -426,7 +426,7 @@ class EquipmentManagerV3(View):
                         'nickname': NickName,
                         'version': version,
                         'region_alexa': region_alexa,
-                        'device_type': is_bind[0]['Type'],
+                        'device_type': is_bind[0]['Type'] if is_bind.exists() else int(Type),
                         'tb_country': country
                     }
                     UidSet = UidSetModel.objects.create(**uid_set_create_dict)
@@ -504,6 +504,7 @@ class EquipmentManagerV3(View):
                 success_res['deviceNumber'] = deviceNumber
                 add_success_flag = True
         except Exception as e:
+            LOGGER.info('异常详情,errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
             print(e)
             error_res = repr(e)
             exception_flag = True