Эх сурвалжийг харах

新增userID__username字段

guanhailong 2 жил өмнө
parent
commit
f066945804

+ 4 - 3
Controller/SuperPasswordTool.py

@@ -126,8 +126,8 @@ class SuperPasswordView(View):
                     super_password_id = "super_password_%s" % userID
                     redisObj = RedisObject()
                     redis = redisObj.set_data(key=super_password_id, val=super_code, expire=86400)
-                    if redis is False:
-                        return response.json(121)
+                    # if redis is False:
+                    #     return response.json(121)
                     device_super_password_qs.update(status=status)
                     if lang == 'en':
                         msg = "Your authorization code is " + super_code + ",valid within 24 hours"
@@ -184,7 +184,8 @@ class SuperPasswordView(View):
                                                                        'status',
                                                                        'buyTime',
                                                                        'hint',
-                                                                       'lang')
+                                                                       'lang',
+                                                                       'userID__username')
             device_super_password_qs = device_super_password_qs.order_by('-addTime')[
                                        (page - 1) * line:page * line]
             return response.json(0, {'list': list(device_super_password_qs), 'count': count})