#NEWLINE# @ bp . route ( '/<int:id>/delete/' , methods = ( 'POST' , ) ) #NEWLINE# def delete_project( id ) : #NEWLINE# #INDENT# project = Project . query . get_or_404 ( id ) #NEWLINE# perms . delete_project ( id ) . test ( http_exception = 403 ) #NEWLINE# ok_to_commit = project . delete ( ) #NEWLINE# if ok_to_commit : #NEWLINE# #INDENT# db . session . commit ( ) #NEWLINE# flash ( 'Project "{}" has been successfully deleted.' . format ( project . gh_full_name ) , 'success' ) #NEWLINE# return redirect ( url_for ( '.index' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# db . session . rollback ( ) #NEWLINE# flash ( 'Something went wrong (probably there was a problem communicating with the GitHub API). Please try again later.' , 'warning' ) #NEWLINE# return redirect ( url_for ( '.settings' , id = id . id ) )