fix the rising page for /r/all and for multi-reddits

This commit is contained in:
spez
2009-07-31 11:05:01 -07:00
parent b939173efb
commit 94c17d8ddb
2 changed files with 11 additions and 1 deletions

View File

@@ -64,4 +64,7 @@ def get_rising(sr):
#get the sr_ids
sr_ids = sr.rising_srs()
rising = cache.get('rising') or ()
return [p[0] for p in filter(lambda pair: pair[1] in sr_ids, rising)]
if sr_ids:
return [p[0] for p in filter(lambda pair: pair[1] in sr_ids, rising)]
else:
return [p[0] for p in rising]

View File

@@ -523,6 +523,9 @@ class AllSR(FakeSubreddit):
q._filter(queries.db_times[time])
return q
def rising_srs(self):
return None
class DefaultSR(FakeSubreddit):
#notice the space before reddit.com
@@ -577,6 +580,10 @@ class MultiReddit(DefaultSR):
def get_links(self, sort, time):
return self.get_links_sr_ids(self.sr_ids, sort, time)
def rising_srs(self):
return self.sr_ids
class SubSR(FakeSubreddit):
stylesheet = 'subreddit.css'
#this will make the javascript not send an SR parameter