You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When uploading files or images using mongoengine, it's unable to view due to the incorrect type being passed to StreamingResponse
To Reproduce
Create an object with a FileField/ImageField
Attempt to view the file you just uploaded. The thumbnail and download functionality don't work
Environment (please complete the following information):
starlette-admin==0.10.0
mongoengine==0.27.0
Python 3.7.16
Additional context
Traceback (most recent call last):
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/uvicorn/protocols/http/httptools_impl.py", line 405, in run_asgi
self.scope, self.receive, self.send
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
return await self.app(scope, receive, send)
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/fastapi/applications.py", line 270, in __call__
await super().__call__(scope, receive, send)
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/starlette/applications.py", line 124, in __call__
await self.middleware_stack(scope, receive, send)
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/starlette/middleware/errors.py", line 184, in __call__
raise exc
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/starlette/middleware/errors.py", line 162, in __call__
await self.app(scope, receive, _send)
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/starlette/middleware/exceptions.py", line 75, in __call__
raise exc
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/starlette/middleware/exceptions.py", line 64, in __call__
await self.app(scope, receive, sender)
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
raise e
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
await self.app(scope, receive, send)
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/starlette/routing.py", line 680, in __call__
await route.handle(scope, receive, send)
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/starlette/routing.py", line 427, in handle
await self.app(scope, receive, send)
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/starlette/applications.py", line 124, in __call__
await self.middleware_stack(scope, receive, send)
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/starlette/middleware/errors.py", line 184, in __call__
raise exc
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/starlette/middleware/errors.py", line 162, in __call__
await self.app(scope, receive, _send)
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/starlette/middleware/exceptions.py", line 75, in __call__
raise exc
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/starlette/middleware/exceptions.py", line 64, in __call__
await self.app(scope, receive, sender)
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/starlette/routing.py", line 680, in __call__
await route.handle(scope, receive, send)
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/starlette/routing.py", line 275, in handle
await self.app(scope, receive, send)
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/starlette/routing.py", line 68, in app
await response(scope, receive, send)
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/starlette/responses.py", line 273, in __call__
await wrap(partial(self.listen_for_disconnect, receive))
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/anyio/_backends/_asyncio.py", line 662, in __aexit__
raise exceptions[0]
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/anyio/_backends/_asyncio.py", line 702, in _run_wrapped_task
await coro
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/starlette/responses.py", line 269, in wrap
await func()
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/starlette/responses.py", line 258, in stream_response
async for chunk in self.body_iterator:
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/starlette/concurrency.py", line 63, in iterate_in_threadpool
yield await anyio.to_thread.run_sync(_next, iterator)
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/anyio/to_thread.py", line 32, in run_sync
func, *args, cancellable=cancellable, limiter=limiter
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/anyio/_backends/_asyncio.py", line 867, in run
result = context.run(func, *args)
File "/Users/enea/lean_mail/backend/venv/lib/python3.7/site-packages/starlette/concurrency.py", line 53, in _next
return next(iterator)
TypeError: 'GridOut' object is not an iterator
The text was updated successfully, but these errors were encountered:
Describe the bug
When uploading files or images using mongoengine, it's unable to view due to the incorrect type being passed to StreamingResponse
To Reproduce
Environment (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: