def get_ajax_job_status_msg(jobid):
    """return the job status msg (as a string)"""
    redis = get_redis()
    # user's browser requesting job status msg
    if not validate_jobid(jobid):
        return Response(
            "Invalid Job ID: %s" % jobid,
            mimetype="text/plain",
            headers={"X-Dalton-Webapp": "OK"},
        )
    stat_code = get_job_status(redis, jobid)
    if stat_code:
        if int(stat_code) == STAT_CODE_RUNNING:
            check_for_timeout(redis, jobid)
        r_status_msg = get_job_status_msg(redis, jobid)
        if r_status_msg:
            return Response(
                r_status_msg, mimetype="text/plain", headers={"X-Dalton-Webapp": "OK"}
            )
        else:
            return Response(
                "Unknown", mimetype="text/plain", headers={"X-Dalton-Webapp": "OK"}
            )
    else:
        return Response(
            "Invalid Job ID: %s" % jobid,
            mimetype="text/plain",
            headers={"X-Dalton-Webapp": "OK"},
        )
return the job status msg (as a string)
app/dalton.py