|
@@ -441,22 +441,22 @@ class EquipmentManagerV3(View):
|
|
dvql = CommonService.qs_to_list(dvqs)
|
|
dvql = CommonService.qs_to_list(dvqs)
|
|
ubqs = UID_Bucket.objects.filter(uid=UID). \
|
|
ubqs = UID_Bucket.objects.filter(uid=UID). \
|
|
values('bucket__content', 'status', 'channel', 'endTime', 'uid')
|
|
values('bucket__content', 'status', 'channel', 'endTime', 'uid')
|
|
- res = dvql[0]
|
|
|
|
- res['vod'] = list(ubqs)
|
|
|
|
|
|
+ success_res = dvql[0]
|
|
|
|
+ success_res['vod'] = list(ubqs)
|
|
iotqs = iotdeviceInfoModel.objects.filter(serial_number=dvql[0]['serial_number'])
|
|
iotqs = iotdeviceInfoModel.objects.filter(serial_number=dvql[0]['serial_number'])
|
|
if iotqs.exists():
|
|
if iotqs.exists():
|
|
- res['iot'] = {'endpoint': iotqs[0].endpoint, 'token_iot_number': iotqs[0].endpoint}
|
|
|
|
|
|
+ success_res['iot'] = {'endpoint': iotqs[0].endpoint, 'token_iot_number': iotqs[0].endpoint}
|
|
add_success_flag = True
|
|
add_success_flag = True
|
|
except Exception as e:
|
|
except Exception as e:
|
|
print(e)
|
|
print(e)
|
|
- res = repr(e)
|
|
|
|
|
|
+ error_res = repr(e)
|
|
exception_flag = True
|
|
exception_flag = True
|
|
pass
|
|
pass
|
|
finally:
|
|
finally:
|
|
if add_success_flag: # 有一台添加成功则返回成功
|
|
if add_success_flag: # 有一台添加成功则返回成功
|
|
- return response.json(0, res)
|
|
|
|
|
|
+ return response.json(0, success_res)
|
|
if exception_flag:
|
|
if exception_flag:
|
|
- return response.json(500, res)
|
|
|
|
|
|
+ return response.json(500, error_res)
|
|
return response.json(0, res)
|
|
return response.json(0, res)
|
|
|
|
|
|
def do_modify(self, userID, request_dict, response, request):
|
|
def do_modify(self, userID, request_dict, response, request):
|