return persons as a list

This commit is contained in:
Davide Alberani 2015-04-14 20:39:09 +02:00
parent 877458fc23
commit 0552f9863d

View file

@ -169,7 +169,7 @@ class EventsHandler(CollectionHandler):
for person in event.get('persons', []): for person in event.get('persons', []):
if str(person.get('person_id')) == resource_id: if str(person.get('person_id')) == resource_id:
return {'person': person} return {'person': person}
return {'persons': event.get('persons') or {}} return {'persons': event.get('persons') or []}
def handle_post_persons(self, id_, person_id, data): def handle_post_persons(self, id_, person_id, data):
# Add a person to the list of persons registered at this event. # Add a person to the list of persons registered at this event.