(event, messages)
return MessagingEvent.STATUS_SLUGS.get(event.status, 'unknown')
The status of the event is not tied to the status of individual messages. An event
    may be 'complete' but some or all of the messages may have errored.

    In the case of completed survey events the status is taken from the XFormsSession.
The status of the event is not tied to the status of individual messages. An event
    may be 'complete' but some or all of the messages may have errored.
The status of the event is not tied to the status of individual messages . An event may be complete but some or all of the messages may have errored .
def _serialize_event_status(event, messages):
    """The status of the event is not tied to the status of individual messages. An event
    may be 'complete' but some or all of the messages may have errored.

    In the case of completed survey events the status is taken from the XFormsSession.
    """
    if event.status == MessagingEvent.STATUS_COMPLETED:
        if event.xforms_session_id:
            return event.xforms_session.status_slug
        if any(message["status"] == SMS.STATUS_ERROR for message in messages):
            return SMS.STATUS_ERROR  # mark event status as 'error' if any messages errored
    return MessagingEvent.STATUS_SLUGS.get(event.status, 'unknown')
def _serialize_event_status ( event , messages ) : if event . status == MessagingEvent . STATUS_COMPLETED : if event . xforms_session_id : return event . xforms_session . status_slug if any ( message [ "status" ] == SMS . STATUS_ERROR for message in messages ) : return SMS . STATUS_ERROR # mark event status as 'error' if any messages errored return MessagingEvent . STATUS_SLUGS . get ( event . status , 'unknown' )