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
As discussed in the Discord, when using List[Link[Type]], the following error is received:
File "/Users/space/.local/share/virtualenvs/api-server-master-haddR1V9/lib/python3.10/site-packages/beanie/odm/documents.py", line 1060, in fetch_all_links
await asyncio.gather(*coros)
File "/Users/space/.local/share/virtualenvs/api-server-master-haddR1V9/lib/python3.10/site-packages/beanie/odm/documents.py", line 1051, in fetch_link
values = await Link.fetch_list(ref_obj, fetch_links=True)
File "/Users/space/.local/share/virtualenvs/api-server-master-haddR1V9/lib/python3.10/site-packages/beanie/odm/fields.py", line 217, in fetch_list
fetched_models = await model_class.find( # type: ignore
AttributeError: 'NoneType' object has no attribute 'find'
Additional context
Running with Motor, and the Optional is potentially important. I always recreate this with a completely fresh database running in docker. Please let me know if you have any issues reproducing this, or any other questions!
The text was updated successfully, but these errors were encountered:
Encounterd the same problem for mandatory fields, if I used fetch_links=True in the find method.
A quick debug later, I guess the problem is in the fetch_list method if the data list is empty (optional field) or no link is a Link (already fetched). So model_class will never get set.
Describe the bug
As discussed in the Discord, when using
List[Link[Type]]
, the following error is received:To Reproduce
Expected behavior
Not this error
Additional context
Running with Motor, and the
Optional
is potentially important. I always recreate this with a completely fresh database running in docker. Please let me know if you have any issues reproducing this, or any other questions!The text was updated successfully, but these errors were encountered: