diff --git a/angular_app/event-tickets.html b/angular_app/event-tickets.html index f21162c..86723bb 100644 --- a/angular_app/event-tickets.html +++ b/angular_app/event-tickets.html @@ -49,7 +49,7 @@ - + {{$index+1}}  {{person.name}} {{person.surname}}{{person.name}} {{person.surname}} <{{person.email}}> diff --git a/angular_app/js/controllers.js b/angular_app/js/controllers.js index 014493f..a721ffe 100644 --- a/angular_app/js/controllers.js +++ b/angular_app/js/controllers.js @@ -425,7 +425,7 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event', person._id = $state.params.id; // that's the id of the event, not the person. EventTicket.add(person, function(ticket) { $log.debug(ticket); - $state.go('event.ticket.edit', {ticket_id: ticket._id}); + $state.go('event.ticket.edit', {id: $scope.event._id, ticket_id: ticket._id}); }); }); }; diff --git a/angular_app/ticket-edit.html b/angular_app/ticket-edit.html index 67cba8d..d09ea1f 100644 --- a/angular_app/ticket-edit.html +++ b/angular_app/ticket-edit.html @@ -4,12 +4,12 @@
-

{{event.title}} - {{'new ticket' | translate}}

+

{{event.title}} - {{'join this event' | translate}} - {{'your ticket' | translate}}

-
+
diff --git a/eventman_server.py b/eventman_server.py index 858ccf6..a693499 100755 --- a/eventman_server.py +++ b/eventman_server.py @@ -89,6 +89,7 @@ class BaseHandler(tornado.web.RequestHandler): 'event:tickets-all|create': True, 'events|read': True, 'persons|create': True, + 'person|create': True, 'users|create': True } @@ -513,9 +514,12 @@ class CollectionHandler(BaseHandler): :param message: message to send :type message: str """ - ws = yield tornado.websocket.websocket_connect(self.build_ws_url(path)) - ws.write_message(message) - ws.close() + try: + ws = yield tornado.websocket.websocket_connect(self.build_ws_url(path)) + ws.write_message(message) + ws.close() + except Exception, e: + self.logger.error('Error yielding WebSocket message: %s', e) class PersonsHandler(CollectionHandler): @@ -615,8 +619,10 @@ class EventsHandler(CollectionHandler): self._clean_dict(data) data['seq'] = self.get_next_seq('event_%s_persons' % id_) data['seq_hex'] = '%06X' % data['seq'] - doc = self.db.query('events', - {'_id': id_, 'persons.person_id': person_id}) + if person_id is None: + doc = {} + else: + doc = self.db.query('events', {'_id': id_, 'persons.person_id': person_id}) ret = {'action': 'add', 'person_id': person_id, 'person': data, 'uuid': uuid} if '_id' in data: del data['_id']