linting issues

This commit is contained in:
Chris Cochrun 2024-06-25 06:30:09 -05:00
parent 9b70af3dba
commit 0330876377
7 changed files with 128 additions and 368 deletions

View file

@ -39,17 +39,13 @@ pub async fn camp_form(MultipartForm(form): MultipartForm<CampForm>) -> HttpResp
let first = form let first = form
.first_name .first_name
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let last = form let last = form
.last_name .last_name
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let full_name = format!("{} {}", first, last); let full_name = format!("{} {}", first, last);
@ -58,114 +54,86 @@ pub async fn camp_form(MultipartForm(form): MultipartForm<CampForm>) -> HttpResp
"{} {}", "{} {}",
form.parent_first_name form.parent_first_name
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from("")
})
.0 .0
.clone(), .clone(),
form.parent_last_name form.parent_last_name
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from("")
})
.0 .0
.clone() .clone()
); );
let birthdate = form let birthdate = form
.birthdate .birthdate
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let gender = form let gender = form
.gender .gender
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let street = form let street = form
.street .street
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let city = form let city = form
.city .city
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let state = form let state = form
.state .state
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let zip = form.zip.as_ref().unwrap_or(&Text { 0: 0 }).0.clone(); let zip = form.zip.as_ref().unwrap_or(&Text(0)).0;
let parent_phone = form let parent_phone = form
.parent_phone .parent_phone
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let parent_email = form let parent_email = form
.parent_email .parent_email
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let grade = form let grade = form
.grade .grade
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let shirt = form let shirt = form
.shirt .shirt
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let allergies = form let allergies = form
.allergies .allergies
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let week = form let week = form
.week .week
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let registration = form let registration = form
.registration .registration
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let reg = registration.clone(); let reg = registration.clone();

View file

@ -45,57 +45,43 @@ pub async fn church_form(MultipartForm(form): MultipartForm<ChurchForm>) -> Http
let relationship = form let relationship = form
.relationship .relationship
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let walk = form let walk = form
.walk .walk
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let positive = form let positive = form
.positive .positive
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let negative = form let negative = form
.negative .negative
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let commitment = form let commitment = form
.commitment .commitment
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let teachable = form let teachable = form
.teachable .teachable
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let notes = form let notes = form
.notes .notes
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
log::info!("{first} {last} filled out a Church Reference form!"); log::info!("{first} {last} filled out a Church Reference form!");

View file

@ -66,245 +66,185 @@ pub async fn health_form(MultipartForm(form): MultipartForm<HealthForm>) -> Http
let first = form let first = form
.first_name .first_name
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let last = form let last = form
.last_name .last_name
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let full_name = format!("{} {}", first, last); let full_name = format!("{} {}", first, last);
let registration = form let registration = form
.registration .registration
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let email_subject = format!("{} {} filled out a health form!", first, last); let email_subject = format!("{} {} filled out a health form!", first, last);
let filename_noext = String::from(format!("{}_{}", first, last)); let filename_noext = format!("{}_{}", first, last);
let parent = format!( let parent = format!(
"{} {}", "{} {}",
form.parent_first_name form.parent_first_name
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from("")
})
.0 .0
.clone(), .clone(),
form.parent_last_name form.parent_last_name
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from("")
})
.0 .0
.clone() .clone()
); );
let birthdate = form let birthdate = form
.birthdate .birthdate
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let street = form let street = form
.street .street
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let city = form let city = form
.city .city
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let state = form let state = form
.state .state
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let zip = form let zip = form
.zip .zip
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let parent_cellphone = form let parent_cellphone = form
.parent_cellphone .parent_cellphone
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let homephone = form let homephone = form
.homephone .homephone
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let contact = form let contact = form
.contact .contact
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let contact_phone = form let contact_phone = form
.contact_phone .contact_phone
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let doctorname = form let doctorname = form
.doctorname .doctorname
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let doctorcity = form let doctorcity = form
.doctorcity .doctorcity
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let doctorphone = form let doctorphone = form
.doctorphone .doctorphone
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let medical = form let medical = form
.medical .medical
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let insurance = form let insurance = form
.insurance .insurance
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let policy_number = form let policy_number = form
.policy_number .policy_number
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let agreement = form let agreement = form
.agreement .agreement
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let allergies = form let allergies = form
.allergies .allergies
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let allergies_other = form let allergies_other = form
.allergies_other .allergies_other
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let specific_allergies = form let specific_allergies = form
.specific_allergies .specific_allergies
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let treatment = form let treatment = form
.treatment .treatment
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let conditions = form let conditions = form
.conditions .conditions
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let tetanus = form let tetanus = form
.tetanus .tetanus
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let swimming = form let swimming = form
.swimming .swimming
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let medication = form let medication = form
.medication .medication
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let notes = form let notes = form
.notes .notes
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
log::info!("{first} {last} filled out a health form!"); log::info!("{first} {last} filled out a health form!");
@ -444,7 +384,7 @@ pub async fn health_form(MultipartForm(form): MultipartForm<HealthForm>) -> Http
log::info!("{:?}", file_exists); log::info!("{:?}", file_exists);
if let Some(f) = form.file { if let Some(f) = form.file {
if let Some(file) = f.file_name { if let Some(file) = f.file_name {
if let Some(ext) = file.rsplit(".").next() { if let Some(ext) = file.rsplit('.').next() {
filename = format!("{}.{}", filename_noext, ext); filename = format!("{}.{}", filename_noext, ext);
path = Some(format!("./tmp/{}.{}", filename_noext, ext)); path = Some(format!("./tmp/{}.{}", filename_noext, ext));
} else { } else {
@ -565,6 +505,6 @@ pub async fn health_form(MultipartForm(form): MultipartForm<HealthForm>) -> Http
// HttpResponse::Ok().body("hi") // HttpResponse::Ok().body("hi")
} }
async fn post_health_form(form: HealthForm) -> bool { async fn post_health_form(_form: HealthForm) -> bool {
todo!() todo!()
} }

View file

@ -44,17 +44,13 @@ pub async fn local_form(MultipartForm(form): MultipartForm<LocalForm>) -> HttpRe
let first = form let first = form
.first_name .first_name
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let last = form let last = form
.last_name .last_name
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let email_subject = format!("{} {} signed up for the local mission trip!", first, last); let email_subject = format!("{} {} signed up for the local mission trip!", first, last);
@ -62,147 +58,111 @@ pub async fn local_form(MultipartForm(form): MultipartForm<LocalForm>) -> HttpRe
"{} {}", "{} {}",
form.parent_first_name form.parent_first_name
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from("")
})
.0 .0
.clone(), .clone(),
form.parent_last_name form.parent_last_name
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from("")
})
.0 .0
.clone() .clone()
); );
let birthdate = form let birthdate = form
.birthdate .birthdate
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let gender = form let gender = form
.gender .gender
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let street = form let street = form
.street .street
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let city = form let city = form
.city .city
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let state = form let state = form
.state .state
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let zip = form.zip.as_ref().unwrap_or(&Text { 0: 0 }).0.clone(); let zip = form.zip.as_ref().unwrap_or(&Text(0)).0;
let cellphone = form let cellphone = form
.cellphone .cellphone
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let parentphone = form let parentphone = form
.parentphone .parentphone
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let email = form let email = form
.email .email
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let parentemail = form let parentemail = form
.parentemail .parentemail
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let school = form let school = form
.school .school
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let grade = form let grade = form
.grade .grade
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let pastor = format!( let pastor = format!(
"{} {}", "{} {}",
form.pastor_first_name form.pastor_first_name
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(), .clone(),
form.pastor_last_name form.pastor_last_name
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from("")
})
.0 .0
.clone() .clone()
); );
let church_attendance = form let church_attendance = form
.church_attendance .church_attendance
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let tfc_group = form let tfc_group = form
.tfc_group .tfc_group
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let shirt = form let shirt = form
.shirt .shirt
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
log::info!("{first} {last} signed up for the local mission trip!"); log::info!("{first} {last} signed up for the local mission trip!");

View file

@ -70,270 +70,204 @@ pub async fn mt_form(MultipartForm(form): MultipartForm<MtForm>) -> HttpResponse
let first = form let first = form
.first_name .first_name
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let last = form let last = form
.last_name .last_name
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let email_subject = format!("{} {} signed up for mission trip!", first, last); let email_subject = format!("{} {} signed up for mission trip!", first, last);
let filename_noext = String::from(format!("{}_{}", first, last)); let filename_noext = format!("{}_{}", first, last);
let parent = format!( let parent = format!(
"{} {}", "{} {}",
form.parent_first_name form.parent_first_name
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from("")
})
.0 .0
.clone(), .clone(),
form.parent_last_name form.parent_last_name
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from("")
})
.0 .0
.clone() .clone()
); );
let birthdate = form let birthdate = form
.birthdate .birthdate
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let gender = form let gender = form
.gender .gender
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let street = form let street = form
.street .street
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let city = form let city = form
.city .city
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let state = form let state = form
.state .state
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let zip = form.zip.as_ref().unwrap_or(&Text { 0: 0 }).0.clone(); let zip = form.zip.as_ref().unwrap_or(&Text(0)).0;
let cellphone = form let cellphone = form
.cellphone .cellphone
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let parentphone = form let parentphone = form
.parentphone .parentphone
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let email = form let email = form
.email .email
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let parentemail = form let parentemail = form
.parentemail .parentemail
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let school = form let school = form
.school .school
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let grade = form let grade = form
.grade .grade
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let pastor = format!( let pastor = format!(
"{} {}", "{} {}",
form.pastor_first_name form.pastor_first_name
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(), .clone(),
form.pastor_last_name form.pastor_last_name
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from("")
})
.0 .0
.clone() .clone()
); );
let church_attendance = form let church_attendance = form
.church_attendance .church_attendance
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let tfc_group = form let tfc_group = form
.tfc_group .tfc_group
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let shirt = form let shirt = form
.shirt .shirt
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let trip = form let trip = form
.trip .trip
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let trip_notes = form let trip_notes = form
.trip_notes .trip_notes
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let relationship = form let relationship = form
.relationship_with_jesus .relationship_with_jesus
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let testimony = form let testimony = form
.testimony .testimony
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let involvement = form let involvement = form
.involvement_with_group .involvement_with_group
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let reasons = form let reasons = form
.reasons .reasons
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let strengths = form let strengths = form
.strengths .strengths
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let weaknesses = form let weaknesses = form
.weaknesses .weaknesses
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let previous_trip = form let previous_trip = form
.previous_trip_info .previous_trip_info
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let attitude = form let attitude = form
.attitude .attitude
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let relevant = form let relevant = form
.relevant_notes .relevant_notes
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let final_agreement = form let final_agreement = form
.final_agreement .final_agreement
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let registration = form let registration = form
.registration .registration
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
log::info!("{first} {last} signed up for mission trip!"); log::info!("{first} {last} signed up for mission trip!");
@ -489,7 +423,7 @@ pub async fn mt_form(MultipartForm(form): MultipartForm<MtForm>) -> HttpResponse
log::info!("{:?}", file_exists); log::info!("{:?}", file_exists);
if let Some(f) = form.file { if let Some(f) = form.file {
if let Some(file) = f.file_name { if let Some(file) = f.file_name {
if let Some(ext) = file.rsplit(".").next() { if let Some(ext) = file.rsplit('.').next() {
filename = format!("{}.{}", filename_noext, ext); filename = format!("{}.{}", filename_noext, ext);
path = Some(format!("./tmp/{}.{}", filename_noext, ext)); path = Some(format!("./tmp/{}.{}", filename_noext, ext));
} else { } else {

View file

@ -46,65 +46,49 @@ pub async fn parent_form(MultipartForm(form): MultipartForm<ParentForm>) -> Http
let email = form let email = form
.email .email
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let authority = form let authority = form
.authority .authority
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let positive = form let positive = form
.positive .positive
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let negative = form let negative = form
.negative .negative
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let family = form let family = form
.family_relation .family_relation
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let previous_trip_info = form let previous_trip_info = form
.previous_trip_info .previous_trip_info
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let feelings = form let feelings = form
.trip_feelings .trip_feelings
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let notes = form let notes = form
.notes .notes
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
log::info!("{first} {last} filled out a parent form!"); log::info!("{first} {last} filled out a parent form!");

View file

@ -42,49 +42,37 @@ pub async fn teacher_form(MultipartForm(form): MultipartForm<TeacherForm>) -> Ht
let relationship = form let relationship = form
.relationship .relationship
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let attitudes = form let attitudes = form
.attitudes .attitudes
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let positive = form let positive = form
.positive .positive
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let negative = form let negative = form
.negative .negative
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let team = form let team = form
.team .team
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
let notes = form let notes = form
.notes .notes
.as_ref() .as_ref()
.unwrap_or(&Text { .unwrap_or(&Text(String::from("")))
0: String::from(""),
})
.0 .0
.clone(); .clone();
log::info!("{first} {last} filled out a teacher form!"); log::info!("{first} {last} filled out a teacher form!");