mirror of https://github.com/MISP/MISP
Fixed validation on Event::_add()
Try atomic save for events Add threat level to JSON samplepull/217/head
parent
f36cc43955
commit
5f155f47cc
|
@ -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) {
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue