Typo causing people at the end of their organic lists to get a 500

This commit is contained in:
ketralnis
2008-09-18 16:39:44 -07:00
parent 6e09acb120
commit 302af955f6
2 changed files with 3 additions and 3 deletions

View File

@@ -193,9 +193,9 @@ organic_pos_key = 'organic_pos'
def organic_pos():
"organic_pos() -> (calc_date = str(), pos = int())"
try:
d,p = get_redditfirst(organic_pos_key, (None,0))
d,p = get_redditfirst(organic_pos_key, ('',0))
except ValueError:
d,p = (None,0)
d,p = ('',0)
return d,p
def set_organic_pos(key,pos):

View File

@@ -168,7 +168,7 @@ def organic_links(user):
cookie_key, pos = organic_pos()
# pos will be 0 if it wasn't specified
if links and (cookie_key == cached_key):
if links and pos != 0:
# make sure that we're not running off the end of the list
pos = pos % len(links)