fix: [log:event_recovery] Delete blocklist entry for recovered event

pull/6327/head
mokaddem 2020-09-18 15:50:26 +02:00
parent c3ef75fcba
commit 18097f05db
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 10 additions and 0 deletions

View File

@ -751,6 +751,9 @@ class Log extends AppModel
if (empty($this->GalaxyCluster)) {
$this->GalaxyCluster = ClassRegistry::init('GalaxyCluster');
}
if (empty($this->EventBlocklist)) {
$this->EventBlocklist = ClassRegistry::init('EventBlocklist');
}
switch($logEntry['action']) {
case 'add':
if (!empty($this->mockRecovery)) {
@ -758,6 +761,13 @@ class Log extends AppModel
} else {
$this->Event->create();
$this->Event->save($logEntry['data']);
$blockListEntry = $this->EventBlocklist->find('first', array(
'conditions' => array('event_uuid' => $logEntry['data']['uuid']),
'fields' => 'id'
));
if (!empty($blockListEntry)) {
$this->EventBlocklist->delete($blockListEntry['EventBlocklist']['id']);
}
}
break;
case 'edit':