diff options
| author | James E. Blair <corvus@gnu.org> | 2010-04-03 10:51:53 -0700 |
|---|---|---|
| committer | James E. Blair <corvus@gnu.org> | 2010-04-03 10:51:53 -0700 |
| commit | 52a3511b1205d7b76b52580e7a9994db5d893afa (patch) | |
| tree | 9cadb59c9eb83377ac0583f43e635cf6ccd45eeb | |
| parent | 7f90d420d1096b4daf9fb5e6269fa0dedec1b5db (diff) | |
Return 404 more often with author search errors.
| -rw-r--r-- | quoins/controllers.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/quoins/controllers.py b/quoins/controllers.py index bb7bcfe..7bdb295 100644 --- a/quoins/controllers.py +++ b/quoins/controllers.py | |||
| @@ -513,12 +513,13 @@ Comment: | |||
| 513 | start=int(start) | 513 | start=int(start) |
| 514 | except: | 514 | except: |
| 515 | raise tg.exceptions.HTTPNotFound().exception | 515 | raise tg.exceptions.HTTPNotFound().exception |
| 516 | blog = DBSession.query(Blog).get(1) | ||
| 517 | |||
| 518 | if not name: | 516 | if not name: |
| 519 | flash('Please supply the name of an author.') | 517 | raise tg.exceptions.HTTPNotFound().exception |
| 520 | redirect(self.url('/')) | 518 | |
| 519 | blog = DBSession.query(Blog).get(1) | ||
| 521 | posts = blog.getPostsByAuthor(name) | 520 | posts = blog.getPostsByAuthor(name) |
| 521 | if not posts: | ||
| 522 | raise tg.exceptions.HTTPNotFound().exception | ||
| 522 | d = post_paginate(start, posts, self.post_paginate) | 523 | d = post_paginate(start, posts, self.post_paginate) |
| 523 | d.update(dict(quoins = self, | 524 | d.update(dict(quoins = self, |
| 524 | blog = blog, | 525 | blog = blog, |
