Permalink
Browse files

views: 404 if no comics found, use Flavor Text on RSS.

  • Loading branch information...
1 parent af18555 commit ca036689f4aae1ee83a06f55183b8b158d65f9dd @MostAwesomeDude committed Jul 30, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 newrem/views.py
View
@@ -229,7 +229,11 @@ def get_neighbors_for(comic):
@app.route("/")
def index():
- comic = Comic.query.order_by(Comic.id.desc()).first()
+ try:
+ comic = Comic.query.order_by(Comic.id.desc()).one()
+ except NoResultFound:
+ abort(404)
+
comics = get_neighbors_for(comic)
newsposts = Newspost.query.order_by(Newspost.time.desc())[:5]
@@ -293,7 +297,7 @@ def rss():
items.append(item)
rss2 = RSS2(title="RSS", link=url_for("index", _external=True),
- description="Hurp!", lastBuildDate=datetime.utcnow(), items=items)
+ description="Flavor Text", lastBuildDate=datetime.utcnow(), items=items)
return rss2.to_xml(encoding="utf8")
@app.route("/500")

0 comments on commit ca03668

Please sign in to comment.