actually check the email
@@ -166,6 +166,12 @@ pub async fn refresh_interviews(db: &Database, company: &Company) -> Result<()>
if !event.summary.ends_with(end)
&& !email.ends_with(&company.gsuite_domain)
&& !email.ends_with(&company.domain)
+ {
+ // Make sure it is and that we shouldn't just skip it.
+ if let Ok(_a) = applicants::dsl::applicants
+ .filter(applicants::dsl::email.eq(attendee.email.to_string()))
+ .first_async::<Applicant>(&db.pool())
+ .await
{
// It must be the person being interviewed.
// See if we can get the Applicant record ID for them.
@@ -175,6 +181,10 @@ pub async fn refresh_interviews(db: &Database, company: &Company) -> Result<()>
// Continue through our loop.
continue;
+ } else {
+ // Just continue, likely the applicant added another email to the event.
+ continue;
+ }
}
let mut final_email = "".to_string();
