def initial_status_ok (db, status_id, cat_id, is_simple) :
    """ Allow "escalated" when submitting new issue. This is allowed in
        case the analysis was done in advance. The first (submission)
        message should contain the analysis results.

        Allow "open" when submitting new non-cert issue. This is allowed
        in case the analysis and decision about implementation was made
        in advance, the first message should contain the analysis
        results and decision.

        Allow open for simple kind (the ones using simple_transitions).
    """
    status = db.status.get (status_id, 'name')
    if status == 'escalated' and not is_simple :
        return True
    if status == 'open' and is_simple :
        return True
    if  (   status == 'open'
        and cat_id
        and     db.category.get (cat_id, 'valid')
        and not db.category.get (cat_id, 'cert_sw')
        ) :
        return True
    return False