Don't fail to remove obsolete downtimes

This commit is contained in:
Yonas Habteab 2024-05-16 12:19:43 +02:00
parent 4eeccce36c
commit 81a94a0759

View File

@ -369,7 +369,7 @@ void Downtime::RemoveDowntime(const String& id, bool includeChildren, DowntimeRe
String config_owner = downtime->GetConfigOwner();
if (!config_owner.IsEmpty() && removalReason != DowntimeExpired) {
if (!config_owner.IsEmpty() && removalReason == DowntimeRemovedByUser) {
BOOST_THROW_EXCEPTION(invalid_downtime_removal_error("Cannot remove downtime '" + downtime->GetName() +
"'. It is owned by scheduled downtime object '" + config_owner + "'"));
}