This commit is contained in:
Dominic Grimm 2023-03-05 14:43:40 +01:00
parent c32356b2bc
commit 487974a07c
No known key found for this signature in database
GPG key ID: 6F294212DEAAC530

View file

@ -114,32 +114,22 @@ async fn teachers(
.teacher_reports() .teacher_reports()
.await? .await?
.into_iter() .into_iter()
.filter_map(|t| { .map(|t| User {
if t.long_name.starts_with("Abi-Aufsicht") username: {
|| t.long_name == "SBBZ" let escaped = escape_username(&t.name);
|| t.long_name == "N.N." match usernames.get_mut(&escaped) {
|| t.long_name == "Werkrealschule" Some(x) => {
{ *x += 1;
None format!("{}{}", escaped, x)
} else { }
Some(User { None => {
username: { usernames.insert(escaped.to_owned(), 1);
let escaped = escape_username(&t.name); escaped
match usernames.get_mut(&escaped) { }
Some(x) => { }
*x += 1; },
format!("{}{}", escaped, x) first_name: t.fore_name,
} last_name: escape_last_name(&t.long_name).to_string(),
None => {
usernames.insert(escaped.to_owned(), 1);
escaped
}
}
},
first_name: t.fore_name,
last_name: escape_last_name(&t.long_name).to_string(),
})
}
}) })
.collect()) .collect())
} }