Compare commits
No commits in common. "0b46cbf8dbb0487a54e092cd5b24f237c441dcd0" and "fdd9c3bdffd8352a3b475156ff4e40f58b0d5f34" have entirely different histories.
0b46cbf8db
...
fdd9c3bdff
@ -594,15 +594,9 @@ 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 {
|
if day_diff >= 7 && !user.has_role_tx(db, "admin").await {
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user