allow to add reason for canceled event; fixes #530
This commit is contained in:
@ -246,16 +246,16 @@ INNER JOIN trip_details ON planned_event.trip_details_id = trip_details.id",
|
||||
let coxes = Registration::all_cox(db, self.id).await;
|
||||
for user in coxes {
|
||||
if let Some(user) = User::find_by_name(db, &user.name).await {
|
||||
let notes = match update.notes {
|
||||
Some(n) if !n.is_empty() => n,
|
||||
_ => ".",
|
||||
let notes = if let Some(notes) = update.notes {
|
||||
format!("Grund der Absage: {notes}")
|
||||
} else {
|
||||
String::from("")
|
||||
};
|
||||
|
||||
Notification::create(
|
||||
db,
|
||||
&user,
|
||||
&format!(
|
||||
"Die Ausfahrt {} am {} um {} wurde abgesagt{}",
|
||||
"Die Ausfahrt {} am {} um {} wurde abgesagt. {}",
|
||||
self.name, self.day, self.planned_starting_time, notes
|
||||
),
|
||||
"Absage Ausfahrt",
|
||||
|
@ -223,16 +223,17 @@ WHERE day=?
|
||||
.rower;
|
||||
for user in rowers {
|
||||
if let Some(user) = User::find_by_name(db, &user.name).await {
|
||||
let notes = match update.notes {
|
||||
Some(n) if !n.is_empty() => n,
|
||||
_ => ".",
|
||||
let notes = if let Some(notes) = update.notes {
|
||||
format!("Grund der Absage: {notes}")
|
||||
} else {
|
||||
String::from("")
|
||||
};
|
||||
|
||||
Notification::create(
|
||||
db,
|
||||
&user,
|
||||
&format!(
|
||||
"Die Ausfahrt von {} am {} um {} wurde abgesagt{}",
|
||||
"Die Ausfahrt von {} am {} um {} wurde abgesagt. {}",
|
||||
update.cox.user.name,
|
||||
update.trip.day,
|
||||
update.trip.planned_starting_time,
|
||||
|
Reference in New Issue
Block a user