From 5ddbcaa41a4952720feb22733d57a2c7507aa95a Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Wed, 2 Dec 2020 12:09:12 +0200 Subject: Move from PyMongo to Motor driver for asynchronous support --- backend/routes/forms/index.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'backend/routes/forms/index.py') 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( -- cgit v1.2.3