|
12 | 12 |
|
13 | 13 | from arthur.apis.directory import freeipa, keycloak, ldap |
14 | 14 | from arthur.config import CONFIG |
15 | | -from arthur.constants import LDAP_BASE_STAFF_ROLE, LDAP_ROLE_MAPPING |
| 15 | +from arthur.constants import HELPER_ROLE_ID, LDAP_ROLE_MAPPING |
16 | 16 | from arthur.log import logger |
17 | 17 |
|
18 | 18 | if TYPE_CHECKING: |
@@ -126,7 +126,7 @@ async def generate_creds(self, interaction: discord.Interaction, _button: ui.But |
126 | 126 | """Generate credentials for the user.""" |
127 | 127 | user = interaction.user |
128 | 128 |
|
129 | | - if LDAP_BASE_STAFF_ROLE not in [role.id for role in user.roles]: |
| 129 | + if HELPER_ROLE_ID not in [role.id for role in user.roles]: |
130 | 130 | await interaction.response.send_message( |
131 | 131 | "You are not eligible for LDAP enrollment.", ephemeral=True |
132 | 132 | ) |
@@ -265,7 +265,7 @@ async def on_member_update(self, before: discord.Member, after: discord.Member) |
265 | 265 | before_roles = {role.id for role in before.roles} |
266 | 266 | after_roles = {role.id for role in after.roles} |
267 | 267 |
|
268 | | - if LDAP_BASE_STAFF_ROLE in before_roles or LDAP_BASE_STAFF_ROLE in after_roles: |
| 268 | + if HELPER_ROLE_ID in before_roles or HELPER_ROLE_ID in after_roles: |
269 | 269 | await self.sync_users() |
270 | 270 |
|
271 | 271 | async def bootstrap(self, user: discord.Member) -> tuple[BootstrapType, str, str | None]: |
@@ -375,7 +375,7 @@ async def get_user_diff( |
375 | 375 |
|
376 | 376 | enrolled_roles = {mapping["discord_role_id"] for mapping in LDAP_ROLE_MAPPING.values()} |
377 | 377 |
|
378 | | - base_role = guild.get_role(LDAP_BASE_STAFF_ROLE) |
| 378 | + base_role = guild.get_role(HELPER_ROLE_ID) |
379 | 379 |
|
380 | 380 | diff = [] |
381 | 381 | missing_emp = [user for user in users if user.employee_number is None] |
|
0 commit comments