Browse Source

设备转移 不是主用户无法转移3

chenshibin 4 years ago
parent
commit
ba4a7e0810
1 changed files with 4 additions and 9 deletions
  1. 4 9
      Controller/CloudTest.py

+ 4 - 9
Controller/CloudTest.py

@@ -76,19 +76,14 @@ class cloudTestView(View):
             newUserName = Device_User.objects.get(userID=newUserID).username
 
             main_exist = Device_Info.objects.filter(UID=uid, vodPrimaryUserID='', vodPrimaryMaster='')
-            vodPrimaryUserID = ''
-            vodPrimaryMaster = ''
-            if main_exist.exists():
-                vodPrimaryUserID = newUserID
-                vodPrimaryMaster = newUserName
-            else:
+
+            if not main_exist.exists():
                 ismain = Device_Info.objects.filter(UID=uid, vodPrimaryUserID=oldUserID)
                 if not ismain.exists():
                     return response.json(10037)
-                else:
-                    vodPrimaryUserID = newUserID
-                    vodPrimaryMaster = newUserName
 
+            vodPrimaryUserID = newUserID
+            vodPrimaryMaster = newUserName
 
             with transaction.atomic():
                 # 更新设备信息