fix: Reverted a change that broke PyMISP's copy_list.py To be revisited for a better solution

pull/1198/head
Iglocska 2016-05-25 01:49:16 +02:00
parent becb42d860
commit f07972af43
2 changed files with 4 additions and 9 deletions

View File

@ -1 +1 @@
{"major":2, "minor":4, "hotfix":46}
{"major":2, "minor":4, "hotfix":47}

View File

@ -995,14 +995,9 @@ class EventsController extends AppController {
} else {
if ($this->_isRest()) { // TODO return error if REST
if(is_numeric($add)) {
$this->response->location(Configure::read('MISP.baseurl') . '/events/' . $add);
$this->response->statusCode(302);
$message = 'Event already exists, if you would like to edit it, use the url in the location header.';
$this->set('name', $message);
$this->set('message', $message);
$this->set('url', $this->here);
$this->set('_serialize', array('name', 'message', 'url'));
return false;
$this->response->header('Location', Configure::read('MISP.baseurl') . '/events/' . $add);
$this->response->send();
throw new NotFoundException('Event already exists, if you would like to edit it, use the url in the location header.');
}
$this->set('name', 'Add event failed.');
$this->set('message', 'The event could not be saved.');