commit
1b1efb88cf
1 changed files with 2 additions and 2 deletions
|
@ -416,16 +416,16 @@ class EventsHandler(CollectionHandler):
|
||||||
data['seq_hex'] = '%06X' % data['seq']
|
data['seq_hex'] = '%06X' % data['seq']
|
||||||
doc = self.db.query('events',
|
doc = self.db.query('events',
|
||||||
{'_id': id_, 'persons.person_id': person_id})
|
{'_id': id_, 'persons.person_id': person_id})
|
||||||
|
ret = {'action': 'add', 'person_id': person_id, 'person': data, 'uuid': uuid}
|
||||||
if '_id' in data:
|
if '_id' in data:
|
||||||
del data['_id']
|
del data['_id']
|
||||||
ret = {'action': 'add', 'person_id': person_id, 'person': data, 'uuid': uuid}
|
self.send_ws_message('event/%s/updates' % id_, json.dumps(ret))
|
||||||
if not doc:
|
if not doc:
|
||||||
merged, doc = self.db.update('events',
|
merged, doc = self.db.update('events',
|
||||||
{'_id': id_},
|
{'_id': id_},
|
||||||
{'persons': data},
|
{'persons': data},
|
||||||
operation='appendUnique',
|
operation='appendUnique',
|
||||||
create=False)
|
create=False)
|
||||||
self.send_ws_message('event/%s/updates' % id_, json.dumps(ret))
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def handle_put_persons(self, id_, person_id, data):
|
def handle_put_persons(self, id_, person_id, data):
|
||||||
|
|
Loading…
Reference in a new issue