def _record_job_status(job_model, job_id, status_str):
    """
    Record a status and return the job object
    """
    from autonomie_base.models.base import DBSESSION
    job = DBSESSION().query(job_model).filter(job_model.id == job_id).first()
    job.status = status_str
    return job
