new newbie flag
This commit is contained in:
@@ -52,6 +52,7 @@ struct EditTripForm<'r> {
|
||||
notes: Option<&'r str>,
|
||||
trip_type: Option<i64>,
|
||||
is_locked: bool,
|
||||
allow_guests: bool,
|
||||
}
|
||||
|
||||
#[post("/trip/<trip_id>", data = "<data>")]
|
||||
@@ -69,6 +70,7 @@ async fn update(
|
||||
notes: data.notes,
|
||||
trip_type: data.trip_type,
|
||||
is_locked: data.is_locked,
|
||||
allow_guests: data.allow_guests,
|
||||
};
|
||||
match Trip::update_own(db, &update).await {
|
||||
Ok(_) => Flash::success(
|
||||
@@ -85,6 +87,10 @@ async fn update(
|
||||
Err(TripUpdateError::TripDetailsDoesNotExist) => {
|
||||
Flash::error(Redirect::to("/planned"), "Ausfahrt gibt's nicht")
|
||||
}
|
||||
Err(TripUpdateError::NeulingAlreadyRegistered) => Flash::error(
|
||||
Redirect::to("/planned"),
|
||||
"Es sind bereits Neulinge angemeldet — 'Neulinge willkommen' kann nicht deaktiviert werden.",
|
||||
),
|
||||
}
|
||||
} else {
|
||||
Flash::error(Redirect::to("/planned"), "Ausfahrt gibt's nicht")
|
||||
|
||||
Reference in New Issue
Block a user