aboutsummaryrefslogtreecommitdiff
path: root/src/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'src/handlers')
-rw-r--r--src/handlers/x500_mapper.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/handlers/x500_mapper.rs b/src/handlers/x500_mapper.rs
index 36ce386..1ec35f2 100644
--- a/src/handlers/x500_mapper.rs
+++ b/src/handlers/x500_mapper.rs
@@ -113,10 +113,12 @@ impl X500Mapper {
if let Some(role) = self.config.students_role {
log::info!("adding the role {} to {}", role, member.display_name());
- member
- .add_role(&ctx.http, role)
- .await
- .context("failed to add student role")?
+ if !member.roles.contains(&role) {
+ member
+ .add_role(&ctx.http, role)
+ .await
+ .context("failed to add student role")?
+ }
}
Ok::<_, anyhow::Error>(())