Skip to content

Commit

Permalink
fixed random selection on home page if less than 6 recordings are ava…
Browse files Browse the repository at this point in the history
…ilable
  • Loading branch information
lkiesow committed Aug 1, 2013
1 parent c690d98 commit 458450f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion portal.py
Expand Up @@ -198,7 +198,8 @@ def home():

# get some random picks
# random.seed()
offsets = [x+1 for x in random.sample(xrange(int(total)), 6)]
total = int(total)
offsets = [x+1 for x in random.sample(xrange(total), min(total,6))]
random_episodes = []
for offset in offsets:
data = request_data('episode',1,offset)
Expand Down

0 comments on commit 458450f

Please sign in to comment.