widget page fix for zero length lists, and /toolbar sends 404 instead of 500 when no link found

This commit is contained in:
KeyserSosa
2008-10-14 11:55:42 -07:00
parent f373061205
commit e02e1539dc
2 changed files with 2 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ class ToolbarController(RedditController):
@validate(link = VByName('id'))
def GET_toolbar(self, link):
if not link: return self.abort404()
link_builder = IDBuilder((link._fullname,))
link_listing = LinkListing(link_builder, nextprev=False).listing()
res = FrameToolbar(link = link_listing.things[0]).render()

View File

@@ -25,14 +25,13 @@
<%
t = thing.things
l = len(t)
two_col = request.get.has_key("twocolumn") if l else False
%>
%for i, a in enumerate(t):
<%
cls = "reddit-link "
cls += "odd " if i % 2 else "even "
cls += "first-half" if i < (l+1)/2 else "second-half"
two_col = request.get.has_key("twocolumn")
%>
%if two_col:
%if i == 0: