@blueprint.route('/jobs/<job_id>', methods=['GET'])
def show_job(job_id):
 job = scheduler.get_job(job_id)
 if (job is None):
  raise werkzeug.exceptions.NotFound('Job not found')
 if isinstance(job, dataset.DatasetJob):
  return flask.redirect(flask.url_for('digits.dataset.views.show', job_id=job_id))
 if isinstance(job, model.ModelJob):
  return flask.redirect(flask.url_for('digits.model.views.show', job_id=job_id))
 if isinstance(job, pretrained_model.PretrainedModelJob):
  return flask.redirect(flask.url_for('digits.pretrained_model.views.show', job_id=job_id))
 else:
  raise werkzeug.exceptions.BadRequest('Invalid job type')

@ blueprint . route ( '/jobs/<job_id>' , methods = [ 'GET' ] ) def show_job ( job_id ) : job = scheduler . get_job ( job_id ) if ( job is None ) : raise werkzeug . exceptions . NotFound ( 'Job not found' ) if isinstance ( job , dataset . DatasetJob ) : return flask . redirect ( flask . url_for ( 'digits.dataset.views.show' , job_id = job_id ) ) if isinstance ( job , model . ModelJob ) : return flask . redirect ( flask . url_for ( 'digits.model.views.show' , job_id = job_id ) ) if isinstance ( job , pretrained_model . PretrainedModelJob ) : return flask . redirect ( flask . url_for ( 'digits.pretrained_model.views.show' , job_id = job_id ) ) else : raise werkzeug . exceptions . BadRequest ( 'Invalid job type' )
redirects to the appropriate /datasets/ or /models/ page .