check before adding a new registered person to an event
This commit is contained in:
parent
41117bf967
commit
c5574f0b4c
2 changed files with 8 additions and 6 deletions
|
@ -41,7 +41,7 @@
|
|||
<body>
|
||||
<nav class="navbar navbar-default navbar-fixed-top" ng-controller="NavigationCtrl as n">
|
||||
<div class="container">
|
||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||
<div class="collapse navbar-collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li ng-class="{active: n.isActive('/events') || n.isActive('/event')}"><a ui-sref="events">{{'Events' | translate}}</a></li>
|
||||
<li ng-class="{active: n.isActive('/persons') || n.isActive('/person') || n.isActive('/import/persons')}"><a ui-sref="persons">{{'Persons' | translate}}</a></li>
|
||||
|
|
|
@ -154,6 +154,8 @@ class EventsHandler(CollectionHandler):
|
|||
return {'persons': event.get('persons') or {}}
|
||||
|
||||
def handle_post_persons(self, id_, person_id, data):
|
||||
if not self.db.query('events',
|
||||
{'_id': id_, 'persons.person_id': person_id}):
|
||||
merged, doc = self.db.update('events',
|
||||
{'_id': id_},
|
||||
{'persons': data},
|
||||
|
|
Loading…
Reference in a new issue