From 1762125788ab998b8403829f4f3b1062adb8cc32 Mon Sep 17 00:00:00 2001 From: Leander Furumo Date: Mon, 22 Apr 2024 02:39:19 +0200 Subject: [PATCH] change return type of fetch_all_galtinn_roles since member and volunteer roles are fetches independently of api we need to return them regardless of group status. --- bot/src/cogs/galtinn.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/src/cogs/galtinn.py b/bot/src/cogs/galtinn.py index 64a9863..6d08a0e 100644 --- a/bot/src/cogs/galtinn.py +++ b/bot/src/cogs/galtinn.py @@ -216,13 +216,13 @@ class Galtinn(commands.Cog): return all_discord_profiles - async def fetch_all_galtinn_roles(self) -> set[int] | None: + async def fetch_all_galtinn_roles(self) -> set[int]: """ Fetch all roles connected to Galtinn groups Returns ---------- - set(int) | None: Set of role ids or None if failed + set(int): Set of role ids """ async def fetch_page(url: str): @@ -250,7 +250,7 @@ class Galtinn(commands.Cog): groups = await fetch_page(initial_url) if not groups or groups.count == 0: - return None + return all_roles for group in groups.results: for discord_role in group.profile.discord_roles: