#NEWLINE# @ bp . route ( '/<int:project_id>/hooks/<int:hook_id>/edit/' , methods = ( 'GET' , 'POST' ) ) #NEWLINE# def edit_hook( project_id , hook_id ) : #NEWLINE# #INDENT# project = get_project ( project_id , for_management = True ) #NEWLINE# hook = project . hooks . filter_by ( id = hook_id ) . first_or_404 ( ) #NEWLINE# form = HookForm ( request . form , obj = hook ) #NEWLINE# if form . validate_on_submit ( ) : #NEWLINE# #INDENT# form . populate_obj ( hook ) #NEWLINE# db . session . add ( hook ) #NEWLINE# db . session . commit ( ) #NEWLINE# return redirect ( url_for ( '.settings' , id = project_id ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return render_template ( 'projects/edit-hook.html' , project = project , form = form )