Fixed validation on Event::_add()

Try atomic save for events
Add threat level to JSON sample
pull/217/head
Alexandru Ciobanu 2013-11-18 16:36:18 +01:00
parent f36cc43955
commit 5f155f47cc
2 changed files with 2 additions and 2 deletions

View File

@ -597,7 +597,7 @@ class EventsController extends AppController {
'Attribute' => array('event_id', 'category', 'type', 'value', 'value1', 'value2', 'to_ids', 'uuid', 'revision', 'timestamp', 'distribution')
);
$saveResult = $this->Event->saveAssociated($data, array('validate' => false, 'fieldList' => $fieldList,
$saveResult = $this->Event->saveAssociated($data, array('validate' => true, 'fieldList' => $fieldList,
'atomic' => true));
// FIXME chri: check if output of $saveResult is what we expect when data not valid, see issue #104
if ($saveResult) {

View File

@ -3,7 +3,7 @@
"id": "15",
"org": "ORG",
"date": "2012-04-12",
"risk": "Medium",
"threat_level_id": "4",
"info": "info",
"user_id": "1",
"uuid": "4f8c2c4e-00dc-42c9-83ad-76e9ff32448e",