aboutsummaryrefslogtreecommitdiffstats
path: root/backend/routes/forms/index.py
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-12-02 12:09:12 +0200
committerGravatar ks129 <[email protected]>2020-12-02 12:09:12 +0200
commit5ddbcaa41a4952720feb22733d57a2c7507aa95a (patch)
treea15e23ba0f7d17e8a00f81ca5a43b18b28cba295 /backend/routes/forms/index.py
parentMerge pull request #11 from python-discord/ks123/models (diff)
Move from PyMongo to Motor driver for asynchronous support
Diffstat (limited to 'backend/routes/forms/index.py')
-rw-r--r--backend/routes/forms/index.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/backend/routes/forms/index.py b/backend/routes/forms/index.py
index 183d5cc..41a3ccd 100644
--- a/backend/routes/forms/index.py
+++ b/backend/routes/forms/index.py
@@ -17,8 +17,9 @@ class FormsList(Route):
async def get(self, request: Request) -> JSONResponse:
forms = []
+ cursor = request.state.db.forms.find()
- for form in request.state.db.forms.find():
+ for form in await cursor.to_list(None):
forms.append(form)
return JSONResponse(