aboutsummaryrefslogtreecommitdiffstats
path: root/backend/discord.py
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2022-02-05 17:35:57 +0200
committerGravatar Hassan Abouelela <[email protected]>2022-02-05 19:49:20 +0400
commit1e5cdeac8d28e798a144374d331bd137c9b1fd93 (patch)
tree437e8ee5305b02ff6f164853f27fd9e71fd3e9af /backend/discord.py
parentFix Linting Errors (diff)
Switch To List Comp
Co-authored-by: Bluenix <[email protected]> Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'backend/discord.py')
-rw-r--r--backend/discord.py4
1 files changed, 1 insertions, 3 deletions
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