6007339 Ensure that Event.id is always set after `Event.get_or_create_from_event()`.

Authored and Committed by jkaluza 5 years ago
    Ensure that Event.id is always set after `Event.get_or_create_from_event()`.
    
    Methods calling `get_or_create_from_event()` expect the Event.id to always
    exist in the returned Event, but the Event.id is only set after the
    `db.session.commit()`.
    
    Therefore in this commit, the `session.commit()` is called in the end
    of `get_or_create_from_event()` to ensure the `id` is always set.
    
    This fixes issues when `@fail_event_on_handler_exception` decorator
    actually did not move the Event to failed state, because the Event.id
    was `None`.
    
        
file modified
+5 -2
file modified
+8 -0