limit-users-to-proper-roles #156

Merged
philipp merged 11 commits from limit-users-to-proper-roles into staging 2024-01-10 14:55:43 +01:00
3 changed files with 4 additions and 7 deletions
Showing only changes of commit a4b8bf1e3f - Show all commits

View File

@ -50,9 +50,9 @@ async fn update(
) -> Flash<Redirect> {
let d = data.into_inner();
if Mail::send(db, d, config.smtp_pw.clone()).await {
return Flash::success(Redirect::to("/admin/mail"), "Mail versendet");
Flash::success(Redirect::to("/admin/mail"), "Mail versendet")
} else {
return Flash::error(Redirect::to("/admin/mail"), "Fehler");
Flash::error(Redirect::to("/admin/mail"), "Fehler")
}
}

View File

@ -252,7 +252,7 @@ async fn home_logbook(
);
};
match logbook.home(db, &user, data.into_inner()).await {
match logbook.home(db,user, data.into_inner()).await {
Ok(_) => Flash::success(Redirect::to("/log"), "Ausfahrt korrekt eingetragen"),
Err(LogbookUpdateError::TooManyRowers(expected, actual)) => Flash::error(Redirect::to("/log"), format!("Zu viele Ruderer (Boot fasst maximal {expected}, es wurden jedoch {actual} Ruderer ausgewählt)")),
Err(LogbookUpdateError::OnlyAllowedToEndTripsEndingToday) => Flash::error(Redirect::to("/log"), "Nur Ausfahrten, die heute enden dürfen eingetragen werden. Für einen Nachtrag schreibe alle Daten Philipp (Tel. nr. siehe Signal oder it@rudernlinz.at)."),

View File

@ -36,10 +36,7 @@ async fn index(
if let Some(msg) = flash {
context.insert("flash", &msg.into_inner());
}
context.insert(
"loggedin_user",
&UserWithRoles::from_user(user.into(), db).await,
);
context.insert("loggedin_user", &UserWithRoles::from_user(user, db).await);
context.insert("days", &days);
Template::render("planned", context.into_json())
}