File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class LDAPGroupMapping(TypedDict):
1313# This is a mapping of LDAP groups to Discord role IDs and GitHub team IDs. It is used to determine
1414# which users should be eligible for LDAP enrollment.
1515LDAP_ROLE_MAPPING : dict [str , LDAPGroupMapping ] = {
16- # "helpers": {"discord_role_id": 267630620367257601, "github_team_slug": "helpers"}, # noqa: ERA001
16+ "helpers" : {"discord_role_id" : 267630620367257601 , "github_team_slug" : "helpers" },
1717 "devops" : {"discord_role_id" : 409416496733880320 , "github_team_slug" : "devops" },
1818 "administrators" : {"discord_role_id" : 267628507062992896 , "github_team_slug" : "admins" },
1919 "moderators" : {"discord_role_id" : 267629731250176001 , "github_team_slug" : "moderators" },
@@ -24,4 +24,4 @@ class LDAPGroupMapping(TypedDict):
2424
2525# Users are only checked for enrollment if they have this role. This doesn't grant them any
2626# permissions, it is for performance to avoid iterating roles for every other user in the guild.
27- HELPER_ROLE_ID = 267630620367257601 # LDAP_ROLE_MAPPING["helpers"]["discord_role_id"]
27+ HELPER_ROLE_ID = LDAP_ROLE_MAPPING ["helpers" ]["discord_role_id" ]
Original file line number Diff line number Diff line change 66
77from arthur .apis .github import GitHubError , add_member_to_team , remove_org_member
88from arthur .config import CONFIG
9+ from arthur .constants import LDAP_ROLE_MAPPING
910
1011if TYPE_CHECKING :
1112 from arthur .bot import KingArthurTheTerrible
@@ -35,7 +36,7 @@ async def github(self, ctx: Context) -> None:
3536 async def add_team_member (self , ctx : Context , username : str ) -> None :
3637 """Add a user to the default GitHub team."""
3738 try :
38- await add_member_to_team (username , "helpers" )
39+ await add_member_to_team (username , LDAP_ROLE_MAPPING [ "helpers" ][ "github_team_slug" ] )
3940 await ctx .send (f":white_check_mark: Successfully invited { username } to the staff team." )
4041 except GitHubError as e :
4142 await ctx .send (f":x: Failed to add { username } to the staff team: { e } " )
You can’t perform that action at this time.
0 commit comments