summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Yves Chibon <pingou@pingoured.fr>2011-11-29 18:26:28 +0100
committerPierre-Yves Chibon <pingou@pingoured.fr>2011-11-29 18:26:28 +0100
commit2142800ce3da00fc98dcbd3897177628047aca95 (patch)
tree65d104e8acec6a317d03a88ffaa0e44b04f53536
parent1721b522ca5a91d674920bf0eed82904e60ecfc3 (diff)
Fix if calling an unexistant review id
-rw-r--r--review-srv-tg2/review_srv/controllers/root.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/review-srv-tg2/review_srv/controllers/root.py b/review-srv-tg2/review_srv/controllers/root.py
index 9ef6ee2..52bdb6c 100644
--- a/review-srv-tg2/review_srv/controllers/root.py
+++ b/review-srv-tg2/review_srv/controllers/root.py
@@ -312,6 +312,9 @@ class RootController(BaseController):
@expose('review_srv.templates.review')
def review(self, review_id):
"""Handle the front-page."""
+ if not model.DBSession.query(Review).get(review_id):
+ flash('This review does not exists')
+ redirect(url('/list'))
review = model.DBSession.query(Review).filter_by(
review_id=review_id).one()