mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 08:17:58 -05:00
widget page fix for zero length lists, and /toolbar sends 404 instead of 500 when no link found
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user