don't notify cancelled trips
This commit is contained in:
@ -77,6 +77,10 @@ WHERE day = ? AND planned_starting_time = ?
|
||||
.await.unwrap()
|
||||
}
|
||||
|
||||
pub fn cancelled(&self, db: &SqlitePool) -> bool {
|
||||
self.max_people == 0
|
||||
}
|
||||
|
||||
/// This function is called when a person registers to a trip or when the cox changes the
|
||||
/// amount of free places.
|
||||
pub async fn check_free_spaces(&self, db: &SqlitePool) {
|
||||
@ -85,7 +89,7 @@ WHERE day = ? AND planned_starting_time = ?
|
||||
return;
|
||||
}
|
||||
|
||||
if self.max_people == 0 {
|
||||
if self.cancelled(db) {
|
||||
// Cox cancelled event, thus it's probably bad weather. Don't bother with sending
|
||||
// notifications
|
||||
return;
|
||||
|
Reference in New Issue
Block a user