|
@@ -162,6 +162,7 @@ class cloudTestView(View):
|
|
new_deviceInfo_qs = Device_Info.objects.filter(userID_id=userID, UID=new_uid).values('isExist')
|
|
new_deviceInfo_qs = Device_Info.objects.filter(userID_id=userID, UID=new_uid).values('isExist')
|
|
if not (old_deviceInfo_qs.exists() and new_deviceInfo_qs.exists()):
|
|
if not (old_deviceInfo_qs.exists() and new_deviceInfo_qs.exists()):
|
|
return response.json(10010)
|
|
return response.json(10010)
|
|
|
|
+ username = old_deviceInfo_qs[0]['userID__username']
|
|
|
|
|
|
# 不是主用户无法转移
|
|
# 不是主用户无法转移
|
|
vodPrimaryUserID = old_deviceInfo_qs[0]['vodPrimaryUserID']
|
|
vodPrimaryUserID = old_deviceInfo_qs[0]['vodPrimaryUserID']
|
|
@@ -182,6 +183,7 @@ class cloudTestView(View):
|
|
'addTime')
|
|
'addTime')
|
|
if not old_using_uid_bucket.exists():
|
|
if not old_using_uid_bucket.exists():
|
|
return response.json(10013)
|
|
return response.json(10013)
|
|
|
|
+ bucket_content = old_using_uid_bucket[0]['bucket__content']
|
|
|
|
|
|
# 免费存储桶不可转移
|
|
# 免费存储桶不可转移
|
|
old_vod_bucket_id = old_using_uid_bucket[0]['bucket_id']
|
|
old_vod_bucket_id = old_using_uid_bucket[0]['bucket_id']
|
|
@@ -236,16 +238,12 @@ class cloudTestView(View):
|
|
'time': int(time.time()),
|
|
'time': int(time.time()),
|
|
'url': 'cloudTransfer/mealTransfer',
|
|
'url': 'cloudTransfer/mealTransfer',
|
|
'content': json.dumps(content),
|
|
'content': json.dumps(content),
|
|
- 'operation': '用户{}的设备{}的套餐{}转移给设备{}'.format(old_deviceInfo_qs[0]['userID__username'], old_uid,
|
|
|
|
- old_using_uid_bucket[0]['bucket__content'], new_uid),
|
|
|
|
|
|
+ 'operation': '用户{}的设备{}的套餐{}转移给设备{}'.format(username, old_uid, bucket_content, new_uid),
|
|
}
|
|
}
|
|
LogModel.objects.create(**log)
|
|
LogModel.objects.create(**log)
|
|
-
|
|
|
|
|
|
+ return response.json(0)
|
|
except Exception as e:
|
|
except Exception as e:
|
|
- # print(e)
|
|
|
|
return response.json(500, repr(e))
|
|
return response.json(500, repr(e))
|
|
- else:
|
|
|
|
- return response.json(0)
|
|
|
|
|
|
|
|
def expireMeal(self, request_dict, response):
|
|
def expireMeal(self, request_dict, response):
|
|
UID_Bucket_id = request_dict.get("UID_Bucket_id", None)
|
|
UID_Bucket_id = request_dict.get("UID_Bucket_id", None)
|