()
return jsonify({'msg': '删除成功', 'status': 1})
删除配置
删除配置
删除配置
def del_config():
    """ 删除配置 """
    data = request.json
    ids = data.get('id')
    _edit = Config.query.filter_by(id=ids).first()
    if current_user.id != Project.query.filter_by(id=_edit.project_id).first().user_id:
        return jsonify({'msg': '不能删除别人项目下的配置', 'status': 0})
    db.session.delete(_edit)
    db.session.commit()
    return jsonify({'msg': '删除成功', 'status': 1})
def del_config ( ) : data = request . json ids = data . get ( 'id' ) _edit = Config . query . filter_by ( id = ids ) . first ( ) if current_user . id != Project . query . filter_by ( id = _edit . project_id ) . first ( ) . user_id : return jsonify ( { 'msg' : '不能删除别人项目下的配置', 'status': 0}) db . session . delete ( _edit ) db . session . commit ( ) return jsonify ( { 'msg' : '删除成功', 'statu s : 1})