diff --git a/nephthys/events/channel_left.py b/nephthys/events/channel_left.py index 61a424a..6045562 100644 --- a/nephthys/events/channel_left.py +++ b/nephthys/events/channel_left.py @@ -15,12 +15,12 @@ async def channel_left(ack: AsyncAck, event: dict, client: AsyncWebClient): users = await client.usergroups_users_list(usergroup=env.slack_user_group) new_users = users.get("users", []) - + try: new_users.remove(user_id) except ValueError: - return - + return + await client.usergroups_users_update( usergroup=env.slack_user_group, users=new_users ) diff --git a/nephthys/macros/hello_world.py b/nephthys/macros/hello_world.py index 5a912fd..ab82880 100644 --- a/nephthys/macros/hello_world.py +++ b/nephthys/macros/hello_world.py @@ -19,4 +19,4 @@ async def run(self, ticket, helper, **kwargs): text=f"hey, {name}! i'm heidi :rac_shy: say hi to orpheus for me would you? :rac_cute:", channel=env.slack_help_channel, thread_ts=ticket.msgTs, - ) \ No newline at end of file + ) diff --git a/nephthys/macros/resolve.py b/nephthys/macros/resolve.py index 3e9220d..f1552ab 100644 --- a/nephthys/macros/resolve.py +++ b/nephthys/macros/resolve.py @@ -29,4 +29,4 @@ async def run(self, ticket: Ticket, helper: User, **kwargs) -> None: f"Ticket with ts {ticket.msgTs} is already closed. No action taken. (Trying to resolve for <@{helper.slackId}>).", messages=[f"Ticket ID: {ticket.id}", f"Helper ID: {helper.id}"], ) - return \ No newline at end of file + return diff --git a/nephthys/macros/types.py b/nephthys/macros/types.py index a87f0c2..ca296ec 100644 --- a/nephthys/macros/types.py +++ b/nephthys/macros/types.py @@ -9,4 +9,4 @@ async def run(self, ticket: Ticket, helper: User, **kwargs) -> None: """ Run the macro with the given arguments. """ - raise NotImplementedError("Subclasses must implement this method.") \ No newline at end of file + raise NotImplementedError("Subclasses must implement this method.") diff --git a/nephthys/tasks/update_helpers.py b/nephthys/tasks/update_helpers.py index 713ff5b..5db6d2e 100644 --- a/nephthys/tasks/update_helpers.py +++ b/nephthys/tasks/update_helpers.py @@ -28,7 +28,9 @@ async def update_helpers(): ) # create new users not in the db - existing_users_in_db = await env.db.user.find_many(where={"slackId": {"in": team_ids}}) + existing_users_in_db = await env.db.user.find_many( + where={"slackId": {"in": team_ids}} + ) existing_user_ids_in_db = {user.slackId for user in existing_users_in_db} new_member_data_to_create = [] diff --git a/nephthys/views/home/tags.py b/nephthys/views/home/tags.py index 9182136..217c33d 100644 --- a/nephthys/views/home/tags.py +++ b/nephthys/views/home/tags.py @@ -30,11 +30,9 @@ async def get_manage_tags_view(user: User) -> dict: ) if tag.userSubscriptions: subIds = [user.userId for user in tag.userSubscriptions] - - subUsers = await env.db.user.find_many( - where={"id": {"in": subIds}} - ) - + + subUsers = await env.db.user.find_many(where={"id": {"in": subIds}}) + subs = [user.slackId for user in subUsers] else: subs = []