peng 2 лет назад
Родитель
Сommit
71038763ef
1 измененных файлов с 3 добавлено и 6 удалено
  1. 3 6
      Controller/UserController.py

+ 3 - 6
Controller/UserController.py

@@ -1359,17 +1359,14 @@ class v2forgetPwdCodeView(TemplateView):
         user_qs = Device_User.objects.filter(Q(phone=phone) | Q(username=phone))
         if not user_qs.exists():
             return response.json(102)
-        users = user_qs[0]
+        users = user_qs.values().first()
         res = {}
         reds = RedisObject()
         reds_key = str(phone) + '_forgetPwdResetCode'
         resetCode = reds.get_data(key=reds_key)
         reds_key_ttl = reds.get_ttl(key=reds_key)
         if reds_key_ttl > 240 and resetCode:
-            # if identifyingCode :
             return response.json(90)
-        # if resetCode is True:
-        #     return response.json(120)
         resetCode = RandomStr(6, True)
         if sign_name == 'zosi':
             sign_ms = '周视'
@@ -1421,7 +1418,7 @@ class v2forgetPwdCodeView(TemplateView):
         user_qs = Device_User.objects.filter(Q(phone=phone) | Q(username=phone))
         if not user_qs.exists():
             return response.json(102)
-        users = user_qs[0]
+        users = user_qs.values().first()
         res = {}
         reds = RedisObject()
         reds_key = str(phone) + '_forgetPwdResetCode'
@@ -1491,7 +1488,7 @@ class v2forgetPwdCodeView(TemplateView):
         user_qs = Device_User.objects.filter(Q(userEmail=email) | Q(username=email))
         if not user_qs.exists():
             return response.json(104)
-        users = user_qs[0]
+        users = user_qs.values().first()
         res = {}
         reds = RedisObject()
         resetCode = reds.get_data(key=email + '_forgetPwdResetCode')