Mercurial > farol > farol
comparison farol/producttree.py @ 136:64a6e69d54fc
Fix an issue where the Wrong Exception was being caught.
author | Benoît Allard <benoit.allard@greenbone.net> |
---|---|
date | Mon, 27 Oct 2014 10:54:52 +0100 |
parents | 5e9237340630 |
children | 584587a000a2 |
comparison
equal
deleted
inserted
replaced
135:5e9237340630 | 136:64a6e69d54fc |
---|---|
142 @producttree_required | 142 @producttree_required |
143 def view_product(productid): | 143 def view_product(productid): |
144 cvrf = get_current() | 144 cvrf = get_current() |
145 try: | 145 try: |
146 product = cvrf.getProductForID(productid) | 146 product = cvrf.getProductForID(productid) |
147 except IndexError: | 147 except KeyError: |
148 abort(404) | 148 abort(404) |
149 return render_template('producttree/view_product.j2', | 149 return render_template('producttree/view_product.j2', |
150 product=product, groups=[g for g in cvrf._producttree._groups if productid in g._productids], | 150 product=product, groups=[g for g in cvrf._producttree._groups if productid in g._productids], |
151 cvrf=cvrf) | 151 cvrf=cvrf) |
152 | 152 |