Compare commits

..

3 Commits

Author SHA1 Message Date
ae1091c9a2 Merge pull request 'allow-retro-logbookentry' (#710) from allow-retro-logbookentry into staging
All checks were successful
CI/CD Pipeline / test (push) Successful in 10m43s
CI/CD Pipeline / deploy-staging (push) Successful in 8m9s
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #710
2024-08-23 12:46:13 +02:00
be6d3229a4 allow retroactively adding logbook entrie
Some checks failed
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled
CI/CD Pipeline / test (push) Has been cancelled
2024-08-23 12:26:08 +02:00
fdd9c3bdff Merge pull request 'allow vorstand to see fees' (#709) from fix-permission into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 10m50s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 8m21s
Reviewed-on: #709
2024-08-22 20:55:22 +02:00

View File

@ -594,9 +594,15 @@ ORDER BY departure DESC
let today = Local::now().date_naive(); let today = Local::now().date_naive();
let day_diff = today - arr.date(); let day_diff = today - arr.date();
let day_diff = day_diff.num_days(); let day_diff = day_diff.num_days();
if day_diff >= 7 && !user.has_role_tx(db, "admin").await { if day_diff >= 7 {
if !user.has_role_tx(db, "admin").await
&& !user
.has_role_tx(db, "allow-retroactive-logbookentries")
.await
{
return Err(LogbookUpdateError::OnlyAllowedToEndTripsEndingToday); return Err(LogbookUpdateError::OnlyAllowedToEndTripsEndingToday);
} }
}
if day_diff < 0 && !user.has_role_tx(db, "admin").await { if day_diff < 0 && !user.has_role_tx(db, "admin").await {
return Err(LogbookUpdateError::OnlyAllowedToEndTripsEndingToday); return Err(LogbookUpdateError::OnlyAllowedToEndTripsEndingToday);
} }