Compare commits

..

3 Commits

Author SHA1 Message Date
96ce46d39c Merge branch 'main' into allow-cancel-of-events
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m47s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-05-21 22:19:33 +02:00
412ec27927 Merge pull request 'remove notificatoin about canceled trip if cancelation has been canceled' (#521) from remove-notification into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m30s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 7m36s
Reviewed-on: #521
2024-05-21 22:18:11 +02:00
64f3596132 remove notificatoin about canceled trip if cancelation has been canceled
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m35s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-05-21 20:43:05 +02:00
2 changed files with 12 additions and 0 deletions

View File

@ -239,6 +239,12 @@ WHERE day=?
.await; .await;
} }
} }
} else {
Notification::delete_by_action(
db,
&format!("remove_user_trip_with_trip_details_id:{}", trip_details_id),
)
.await;
} }
if max_people > 0 && was_already_cancelled { if max_people > 0 && was_already_cancelled {

View File

@ -77,6 +77,12 @@ WHERE day = ? AND planned_starting_time = ?
return; return;
} }
if self.max_people == 0 {
// Cox cancelled event, thus it's probably bad weather. Don't bother with sending
// notifications
return;
}
if Trip::find_by_trip_details(db, self.id).await.is_none() { if Trip::find_by_trip_details(db, self.id).await.is_none() {
// This trip_details belongs to a planned_event, no need to do anything // This trip_details belongs to a planned_event, no need to do anything
return; return;