(u, p)
return render_template('delete_project.html', project=p)
Delete an existing project.
Delete an existing project.
Delete an existing project .
def delete_project(u, p):
    """
    Delete an existing project.
    """
    if p.owner.id != g.user.id:
        # Project isn't public and the viewer isn't the project owner.
        # (403 Forbidden)
        return abort(403)

    if request.method == 'POST' and request.form.get('do') == 'd':
        db.session.delete(p)
        db.session.commit()
        return redirect(url_for('.dashboard', u=u.username))

    return render_template('delete_project.html', project=p)
def delete_project ( u , p ) : if p . owner . id != g . user . id : # Project isn't public and the viewer isn't the project owner. # (403 Forbidden) return abort ( 403 ) if request . method == 'POST' and request . form . get ( 'do' ) == 'd' : db . session . delete ( p ) db . session . commit ( ) return redirect ( url_for ( '.dashboard' , u = u . username ) ) return render_template ( 'delete_project.html' , project = p )