Mercurial > farol
changeset 22:dbfe89e3c6fe
Fix producttree urls
author | Benoît Allard <benoit.allard@greenbone.net> |
---|---|
date | Thu, 02 Oct 2014 11:23:49 +0200 |
parents | e66fd84439bd |
children | e410f6f0f80f |
files | farol/producttree.py |
diffstat | 1 files changed, 10 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/farol/producttree.py Wed Oct 01 09:43:56 2014 +0200 +++ b/farol/producttree.py Thu Oct 02 11:23:49 2014 +0200 @@ -41,7 +41,7 @@ def decorated_function(*args, **kwargs): if get_current()._producttree is None: flash('Operation invalid without producttree', 'warning') - return redirect(url_for('document')) + return redirect(url_for('document.view')) return f(*args, **kwargs) return decorated_function @@ -49,7 +49,7 @@ @document_required def create(): get_current().createProductTree() - return redirect(url_for('document')) + return redirect(url_for('document.view')) @producttree.route('/branch/<path:path>/edit', methods=['GET', 'POST']) @@ -82,7 +82,7 @@ branch._type = request.form['type'] branch._name = request.form['name'] - return redirect(url_for('document')) + return redirect(url_for('document.view')) @producttree.route('/branch/add', methods=['GET', 'POST']) @document_required @@ -99,7 +99,7 @@ pbranch = ptree.getBranch([int(p) for p in request.form['parent'].split('/')]) branch = CVRFProductBranch(request.form['type'], request.form['name'], pbranch) ptree.addBranch(branch) - return redirect(url_for('document')) + return redirect(url_for('document.view')) @producttree.route('/product/<productid>') @document_required @@ -158,7 +158,7 @@ product._productid = request.form['productid'] product._name = request.form['name'] product._cpe = request.form['cpe'] or None - return redirect(url_for('document')) + return redirect(url_for('document.view')) @producttree.route('/product/add', methods=['GET', 'POST']) @document_required @@ -185,7 +185,7 @@ product = CVRFFullProductName(request.form['productid'], request.form['name'], parent, request.form['cpe'] or None) ptree.addProduct(product) - return redirect(url_for('document')) + return redirect(url_for('document.view')) @producttree.route('/relationship/<int:index>/edit', methods=['GET', 'POST']) @document_required @@ -204,7 +204,7 @@ rel._productreference = request.form['productreference'] rel._relationtype = request.form['relationtype'] rel._relatestoproductreference = request.form['relatestoproductreference'] - return redirect(url_for('document')) + return redirect(url_for('document.view')) @producttree.route('/relationship/add', methods=['GET', 'POST']) @document_required @@ -228,7 +228,7 @@ rel = CVRFRelationship(prodid1, request.form['relationtype'], prodid2) ptree.addRelationship(rel) - return redirect(url_for('document')) + return redirect(url_for('document.view')) @producttree.route('/group/<groupid>/edit', methods=['GET', 'POST']) @document_required @@ -246,7 +246,7 @@ group._productids = [] for productid in request.form.getlist('products'): group.addProductID(productid) - return redirect(url_for('document')) + return redirect(url_for('document.view')) @producttree.route('/group/add', methods=['GET', 'POST']) @document_required @@ -260,4 +260,4 @@ for productid in request.form.getlist('products'): group.addProductID(productid) get_current()._producttree.addGroup(group) - return redirect(url_for('document')) + return redirect(url_for('document.view'))