Don't fail to remove obsolete downtimes

This commit is contained in:
Yonas Habteab 2024-05-16 12:19:43 +02:00 committed by Alexander A. Klimov
parent 6347c9089d
commit ad7495dc0e

View File

@ -359,7 +359,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 + "'"));
}