Пример #1
0
def set_rtu_status_ko(rtu: RealTimeUpdate, error: str, is_reprocess_same_data_allowed: bool) -> None:
    """
    Set RealTimeUpdate's status to KO, handling all in one
    except commit and logs
    :param rtu: RealTimeUpdate object to amend
    :param error: error message to associate to RTU
    :param is_reprocess_same_data_allowed: If the same input is provided next time, should we
    reprocess it (hoping a happier ending)
    """
    if is_reprocess_same_data_allowed:
        allow_reprocess_same_data(rtu.contributor_id)

    rtu.status = "KO"
    rtu.error = error