amisadmin / fastapi-user-auth

FastAPI-User-Auth is a simple and powerful FastAPI user RBAC authentication and authorization library. Based on FastAPI-Amis-Admin and provides a freely extensible visual management interface.
319 stars 43 forks source link

注册用户时报错 AttributeError: __aenter__ #10

Closed liufengting closed 1 year ago

liufengting commented 1 year ago

Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/uvicorn/protocols/http/httptools_impl.py", line 372, in run_asgi result = await app(self.scope, self.receive, self.send) File "/usr/local/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 75, in call return await self.app(scope, receive, send) File "/usr/local/lib/python3.9/site-packages/uvicorn/middleware/debug.py", line 96, in call raise exc from None File "/usr/local/lib/python3.9/site-packages/uvicorn/middleware/debug.py", line 93, in call await self.app(scope, receive, inner_send) File "/usr/local/lib/python3.9/site-packages/fastapi/applications.py", line 261, in call await super().call(scope, receive, send) File "/usr/local/lib/python3.9/site-packages/starlette/applications.py", line 112, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 181, in call raise exc File "/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 159, in call await self.app(scope, receive, _send) File "/usr/local/lib/python3.9/site-packages/starlette/middleware/cors.py", line 92, in call await self.simple_response(scope, receive, send, request_headers=headers) File "/usr/local/lib/python3.9/site-packages/starlette/middleware/cors.py", line 147, in simple_response await self.app(scope, receive, send) File "/usr/local/lib/python3.9/site-packages/starlette/exceptions.py", line 82, in call raise exc File "/usr/local/lib/python3.9/site-packages/starlette/exceptions.py", line 71, in call await self.app(scope, receive, sender) File "/usr/local/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in call raise e File "/usr/local/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in call await self.app(scope, receive, send) File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 656, in call await route.handle(scope, receive, send) File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 408, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.9/site-packages/fastapi/applications.py", line 261, in call await super().call(scope, receive, send) File "/usr/local/lib/python3.9/site-packages/starlette/applications.py", line 112, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 181, in call raise exc File "/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 159, in call await self.app(scope, receive, _send) File "/usr/local/lib/python3.9/site-packages/starlette/exceptions.py", line 82, in call raise exc File "/usr/local/lib/python3.9/site-packages/starlette/exceptions.py", line 71, in call await self.app(scope, receive, sender) File "/usr/local/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in call raise e File "/usr/local/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in call await self.app(scope, receive, send) File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 656, in call await route.handle(scope, receive, send) File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 259, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 61, in app response = await func(request) File "/usr/local/lib/python3.9/site-packages/fastapi/routing.py", line 217, in app solved_result = await solve_dependencies( File "/usr/local/lib/python3.9/site-packages/fastapi/dependencies/utils.py", line 527, in solve_dependencies solved = await call(**sub_values) File "/usr/local/lib/python3.9/site-packages/fastapi_amis_admin/admin/admin.py", line 832, in route return await self.handle(request, data) # type:ignore File "/usr/local/lib/python3.9/site-packages/fastapi_user_auth/admin.py", line 128, in handle async with request.auth.db.session_maker() as session: AttributeError: aenter