#NEWLINE# @ bp . route ( '/<int:project_id>/builds/<id>/' ) #NEWLINE# def build( project_id , id ) : #NEWLINE# #INDENT# project = get_project ( project_id , for_management = False ) #NEWLINE# if ( id == 'latest' ) : #NEWLINE# #INDENT# build = project . get_latest_build ( ref = request . args . get ( 'ref' ) ) #NEWLINE# if ( not build ) : #NEWLINE# #INDENT# return redirect ( url_for ( '.settings' , id = project_id ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# build_id = int ( id ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# abort ( 404 ) #NEWLINE# #UNINDENT# build = project . builds . filter_by ( id = build_id ) . first_or_404 ( ) #NEWLINE# #UNINDENT# job = build . jobs . first ( ) #NEWLINE# return render_template ( 'projects/job.html' , is_build_latest = ( id == 'latest' ) , project = project , build = build , job = job )