From 1e5cdeac8d28e798a144374d331bd137c9b1fd93 Mon Sep 17 00:00:00 2001 From: Hassan Abouelela Date: Sat, 5 Feb 2022 17:35:57 +0200 Subject: Switch To List Comp Co-authored-by: Bluenix Signed-off-by: Hassan Abouelela --- backend/discord.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'backend/discord.py') diff --git a/backend/discord.py b/backend/discord.py index 6c8eefe..f972f5f 100644 --- a/backend/discord.py +++ b/backend/discord.py @@ -80,9 +80,7 @@ async def get_roles( name="inserted_at", ) - roles = [] - async for role in collection.find(): - roles.append(models.DiscordRole(**json.loads(role["data"]))) + roles = [models.DiscordRole(**json.loads(role["data"])) async for role in collection.find()] if len(roles) == 0: # Fetch roles from the API and insert into the database -- cgit v1.2.3