报错信息如下:
127.0.0.1 - - [19/Jan/2021 22:16:44] "GET /cms/admin/users?count=10&page=0 HTTP/1.1" 500 -
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 2464, in call
return self.wsgi_app(environ, start_response)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 2450, in wsgi_app
response = self.handle_exception(e)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, kwargs)))
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1867, in handle_exception
reraise(exc_type, exc_value, tb)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(args, kwargs)))
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1822, in handle_user_exception
return handler(e)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/lin/init.py", line 269, in handler
raise e
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](req.view_args)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/lin/jwt.py", line 38, in wrapper
return fn(args, kwargs)
File "/Users/liurui/Desktop/lin-cms-flask/app/api/cms/admin.py", line 103, in get_admin_users
groups = [group_dict[group_id] for group_id in group_id_list]
File "/Users/liurui/Desktop/lin-cms-flask/app/api/cms/admin.py", line 103, in
groups = [group_dict[group_id] for group_id in group_id_list]
KeyError: 1
请问
如何解决
cms查询用户列表接口500出错
报错信息如下: 127.0.0.1 - - [19/Jan/2021 22:16:44] "GET /cms/admin/users?count=10&page=0 HTTP/1.1" 500 - Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 2464, in call return self.wsgi_app(environ, start_response) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 2450, in wsgi_app response = self.handle_exception(e) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function return cors_after_request(app.make_response(f(*args, kwargs))) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1867, in handle_exception reraise(exc_type, exc_value, tb) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise raise value File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function return cors_after_request(app.make_response(f(args, kwargs))) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1822, in handle_user_exception return handler(e) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/lin/init.py", line 269, in handler raise e File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request return self.view_functions[rule.endpoint](req.view_args) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/lin/jwt.py", line 38, in wrapper return fn(args, kwargs) File "/Users/liurui/Desktop/lin-cms-flask/app/api/cms/admin.py", line 103, in get_admin_users groups = [group_dict[group_id] for group_id in group_id_list] File "/Users/liurui/Desktop/lin-cms-flask/app/api/cms/admin.py", line 103, in
groups = [group_dict[group_id] for group_id in group_id_list]
KeyError: 1
请问
如何解决