diff --git a/src/bin/update_data.rs b/src/bin/update_data.rs index 414fbb7..c578ac2 100644 --- a/src/bin/update_data.rs +++ b/src/bin/update_data.rs @@ -98,9 +98,18 @@ async fn update_ldap(config: &Config, db: &Pool) { } impl From<&WolvesResultUser> for AccountWolves { fn from(input: &WolvesResultUser) -> Self { + let id_student = match input.student_id.to_owned() { + None => { + Some("00000000".to_string()) + } + Some(x) => { + Some(x) + } + }; + AccountWolves { id_wolves: input.member_id.parse::().unwrap_or(0), - id_student: input.student_id.to_owned(), + id_student, email: input.contact_email.to_owned(), expiry: input.expiry.to_owned(), name_first: Some(input.first_name.to_owned()),