no special treatment for 'externes boot'

This commit is contained in:
2024-04-24 17:15:53 +02:00
parent 8b42bdce0c
commit 87307378c6
5 changed files with 8 additions and 8 deletions

View File

@ -27,7 +27,7 @@ pub struct Boat {
#[serde(default = "bool::default")]
skull: bool,
#[serde(default = "bool::default")]
external: bool,
pub external: bool,
pub deleted: bool,
}

View File

@ -582,13 +582,13 @@ ORDER BY departure DESC
).await;
}
if boat.name == "Externes Boot" {
if boat.external {
let vorstand = Role::find_by_name_tx(db, "Vorstand").await.unwrap();
Notification::create_for_role_tx(
db,
&vorstand,
&format!("'{}' hat eine Ausfahrt mit *Externem Boot* am {} eingetragen ({} km; Ziel: {}; Anmerkungen: {}). Falls das nicht stimmen sollte, bitte nachhaken.",user.name,log.departure,log.distance_in_km, log.destination, log.comments.unwrap_or("".into())),
&format!("'{}' hat eine Ausfahrt mit externem Boot '{}' am {} eingetragen ({} km; Ziel: {}; Anmerkungen: {}). Falls das nicht stimmen sollte, bitte nachhaken.",user.name,boat.name,log.departure,log.distance_in_km, log.destination, log.comments.unwrap_or("".into())),
"Ausfahrt mit externem Boot eingetragen",
None,
).await;

View File

@ -40,7 +40,7 @@ LEFT JOIN
LEFT JOIN
location ON boat.location_id = location.id
WHERE
boat.name != 'Externes Boot' AND not boat.external
not boat.external
GROUP BY
boat.id, year
ORDER BY
@ -115,7 +115,7 @@ LEFT JOIN (
FROM rower
GROUP BY logbook_id
) m ON l.id = m.logbook_id
WHERE l.distance_in_km IS NOT NULL AND l.arrival LIKE '{year}-%' AND b.name != 'Externes Boot';
WHERE l.distance_in_km IS NOT NULL AND l.arrival LIKE '{year}-%' AND not b.external;
"
))
.fetch_one(db)