Move log message

refs #5094
This commit is contained in:
Gunnar Beutner 2017-03-27 11:01:14 +02:00
parent a73c1580ca
commit 95093bae3e
2 changed files with 2 additions and 8 deletions

View File

@ -208,15 +208,12 @@ void Comment::RemoveComment(const String& id, const MessageOrigin::Ptr& origin)
{
Comment::Ptr comment = Comment::GetByName(id);
if (!comment)
if (!comment || comment->GetPackage() != "_api")
return;
Log(LogNotice, "Comment")
<< "Removed comment '" << comment->GetName() << "' from object '" << comment->GetCheckable()->GetName() << "'.";
if (comment->GetPackage() != "_api")
return;
Array::Ptr errors = new Array();
if (!ConfigObjectUtility::DeleteObject(comment, false, errors)) {

View File

@ -294,7 +294,7 @@ void Downtime::RemoveDowntime(const String& id, bool cancelled, bool expired, co
{
Downtime::Ptr downtime = Downtime::GetByName(id);
if (!downtime)
if (!downtime || downtime->GetPackage() != "_api")
return;
String config_owner = downtime->GetConfigOwner();
@ -310,9 +310,6 @@ void Downtime::RemoveDowntime(const String& id, bool cancelled, bool expired, co
Log(LogNotice, "Downtime")
<< "Removed downtime '" << downtime->GetName() << "' from object '" << downtime->GetCheckable()->GetName() << "'.";
if (downtime->GetPackage() != "_api")
return;
Array::Ptr errors = new Array();
if (!ConfigObjectUtility::DeleteObject(downtime, false, errors)) {