From 47f1da350b99950fec46022ed6eefb5db389a8b0 Mon Sep 17 00:00:00 2001 From: squiddy Date: Thu, 25 Jan 2024 02:06:16 +0800 Subject: [PATCH] add note + remove a pass --- bot/src/bot/cogs/github_auth.py | 1 + bot/src/bot/cogs/ms_auth.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bot/src/bot/cogs/github_auth.py b/bot/src/bot/cogs/github_auth.py index 8c79d29..bb3e479 100644 --- a/bot/src/bot/cogs/github_auth.py +++ b/bot/src/bot/cogs/github_auth.py @@ -132,6 +132,7 @@ async def do_verification(self, appventure_member: Member, github_username: str, def prune_auth_flows(self, github_auth_flows: MutableMapping[str, Tuple[int, int]]) -> None: current_time = time.time() current_auth_flows = github_auth_flows + # wrap in list to create a copy of items (we modify the dict in the loop) for key, auth_flow_data in list(current_auth_flows.items()): if current_time - auth_flow_data[0] >= 86400: del github_auth_flows[key] diff --git a/bot/src/bot/cogs/ms_auth.py b/bot/src/bot/cogs/ms_auth.py index 29c2d5b..32c97b2 100644 --- a/bot/src/bot/cogs/ms_auth.py +++ b/bot/src/bot/cogs/ms_auth.py @@ -292,8 +292,7 @@ async def verify(self, interaction: Interaction) -> None: database.get_member_by_discord_id(member.id) or len({self.cache.alumni_role, self.cache.guest_role}.intersection(member.roles)) > 0 ): - # return await send_error(interaction, "You are already verified!", ephemeral=True) - pass + return await send_error(interaction, "You are already verified!", ephemeral=True) message = self.get_verify_message(interaction.user.id) @@ -321,6 +320,7 @@ async def manual_verify( def prune_auth_flows(self, auth_flows: MutableMapping[str, Tuple[int, int, Any]]) -> None: current_time = time.time() current_auth_flows: MutableMapping[str, Tuple[int, int, Any]] = auth_flows + # wrap in list to create a copy of items (we modify the dict in the loop) for key, auth_flow_data in list(current_auth_flows.items()): if current_time - auth_flow_data[0] >= 86400: del auth_flows[key]