clean w/ clippy
All checks were successful
CI/CD Pipeline / test (push) Successful in 12m52s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped

This commit is contained in:
2024-04-15 23:26:52 +02:00
parent 151e1b7864
commit 2694829b6e
7 changed files with 13 additions and 16 deletions

View File

@ -26,7 +26,7 @@ async fn index(
}
context.insert(
"loggedin_user",
&UserWithRoles::from_user(user.user.into(), db).await,
&UserWithRoles::from_user(user.user, db).await,
);
context.insert("roles", &Role::all(db).await);
@ -57,7 +57,7 @@ async fn send(
return Flash::error(Redirect::to("/admin/notification"), "Rolle gibt's ned");
};
for user in User::all_with_role(&db, &role).await {
for user in User::all_with_role(db, &role).await {
Notification::create(db, &user, &d.message, &d.category, None).await;
}
Log::create(db, "Notification successfully sent".into()).await;

View File

@ -27,10 +27,8 @@ async fn index(
let boats = Boat::all_for_boatshouse(db).await;
let mut final_boats = Vec::new();
for boat in boats {
if boat.boat.boathouse(db).await.is_none() {
if boat.boat.name != "Externes Boot" {
final_boats.push(boat);
}
if boat.boat.boathouse(db).await.is_none() && boat.boat.name != "Externes Boot" {
final_boats.push(boat);
}
}

View File

@ -161,7 +161,7 @@ async fn delete<'r>(
} else {
Flash::error(
Redirect::to("/boatreservation"),
format!("Nur der Reservierer darf die Reservierung löschen."),
"Nur der Reservierer darf die Reservierung löschen.".to_string(),
)
}
}

View File

@ -66,8 +66,8 @@ async fn steering(db: &State<SqlitePool>, user: User, flash: Option<FlashMessage
let mut coxes = User::all_with_role(db, &Role::find_by_name(db, "cox").await.unwrap()).await;
coxes.retain(|user| !bootskundige.contains(&user)); // Remove bootskundige from coxes list
coxes.retain(|user| user.name != String::from("Externe Steuerperson"));
coxes.retain(|user| !bootskundige.contains(user)); // Remove bootskundige from coxes list
coxes.retain(|user| user.name != "Externe Steuerperson");
context.insert("coxes", &coxes);
context.insert("bootskundige", &bootskundige);