show message for no match

This commit is contained in:
Davide Alberani 2017-04-15 13:35:15 +02:00
parent b6edc6c913
commit d0e4f2188f
3 changed files with 13 additions and 3 deletions

View file

@ -17,6 +17,7 @@
/* Register our fantastic app. */
var eventManApp = angular.module('eventManApp', [
'ngRoute',
'ngAnimate',
'eventManServices',
'eventManControllers',
'ui.bootstrap',

View file

@ -816,10 +816,14 @@ class EventsHandler(CollectionHandler):
self.send_ws_message('event/%s/tickets/updates' % id_, json.dumps(ret))
self.set_status(400)
return ret
elif nr_matches == 1:
old_ticket_data = matching_tickets[0]
elif nr_matches == 0:
ret = {'error': True, 'message': 'no ticket matched', 'query': query,
'uuid': uuid, 'username': self.current_user_info.get('username', '')}
self.send_ws_message('event/%s/tickets/updates' % id_, json.dumps(ret))
self.set_status(400)
return ret
else:
old_ticket_data = {}
old_ticket_data = matching_tickets[0]
# We have changed the "cancelled" status of a ticket to False; check if we still have a ticket available
if 'number_of_tickets' in current_event and old_ticket_data.get('cancelled') and not data.get('cancelled'):

View file

@ -103,3 +103,8 @@ input[type=text].form-control, input[type=search].form-control {
#toast-container.toast-bottom-center>div, #toast-container.toast-center>div, #toast-container.toast-top-center>div {
margin-bottom: 4px;
}
:not(.no-enter)#toast-container > div.ng-enter
{
transition-duration: .1s;
}