Example #1
0
def delete():
    # username = session.get('username')
    session_token = session.get("session_token")

    if not session_token:
        print "session_token not exists!"
        return None

    # app_name = app_name
    # app_id = request.args.get('app_id')
    # print 'the app_id of the app is: %s' %(str(app_id))

    user = Developer()
    user.session_token = session_token
    # print 'The form is: %s' %(str(request.form))
    # _xsrf = request.form.get('_xsrf')
    app_id = request.form.get("app_id")

    dashboard = Dashboard()
    dashboard.app_id = app_id

    res = user.delete_app(app_id=app_id, kind=None)
    if res == 0:
        response_json = {"delete": "success"}
        return jsonify(response_json)
    else:
        response_json = {"delete": "failed"}
        return jsonify(response_json)