Merge a7fc1e9b98
into 0feac2d904
This commit is contained in:
commit
e50d4f579d
18
src/main.rs
18
src/main.rs
|
@ -137,7 +137,6 @@ fn invite_from_ldap(
|
||||||
let mut num_users = 0;
|
let mut num_users = 0;
|
||||||
|
|
||||||
for ldap_user in search_entries(config)? {
|
for ldap_user in search_entries(config)? {
|
||||||
//
|
|
||||||
// Safely get first email from list of emails in field
|
// Safely get first email from list of emails in field
|
||||||
if let Some(user_email) = ldap_user
|
if let Some(user_email) = ldap_user
|
||||||
.attrs
|
.attrs
|
||||||
|
@ -148,9 +147,20 @@ fn invite_from_ldap(
|
||||||
println!("User with email already exists: {}", user_email);
|
println!("User with email already exists: {}", user_email);
|
||||||
} else {
|
} else {
|
||||||
println!("Try to invite user: {}", user_email);
|
println!("Try to invite user: {}", user_email);
|
||||||
client
|
if let Err(request_error) = client.invite(user_email) {
|
||||||
.invite(user_email)
|
match request_error {
|
||||||
.context(format!("Failed to invite user {}", user_email))?;
|
vw_admin::ResponseError::HttpError(api_error) if api_error.is_body() => {
|
||||||
|
println!(
|
||||||
|
"Failed to invite user {} with request body error {}",
|
||||||
|
user_email, api_error
|
||||||
|
)
|
||||||
|
}
|
||||||
|
_ => panic!(
|
||||||
|
"Failed to invite user {} with error {}",
|
||||||
|
user_email, request_error
|
||||||
|
),
|
||||||
|
}
|
||||||
|
}
|
||||||
num_users += 1;
|
num_users += 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue