Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Delete randomized_promotion_list.

  • Loading branch information...
commit 94a7ee0eb9ac40b08b311c0375ef83c3ab3d48ff 1 parent ab31259
@bsimpson63 bsimpson63 authored
Showing with 0 additions and 17 deletions.
  1. +0 −17 r2/r2/lib/promote.py
View
17 r2/r2/lib/promote.py
@@ -785,23 +785,6 @@ def make_daily_promotions(offset=0, test=False):
"promotions: %r" % error_campaigns)
-def randomized_promotion_list(user, site):
- promos = get_promotion_list(user, site)
- # no promos, no problem
- if not promos:
- return []
- # more than two: randomize
- elif len(promos) > 1:
- n = random.uniform(0, 1)
- for i, (l, w, cid) in enumerate(promos):
- n -= w
- if n < 0:
- promos = promos[i:] + promos[:i]
- break
- # fall thru for the length 1 case here as well
- return [(l, cid) for l, w, cid in promos]
-
-
PromoTuple = namedtuple('PromoTuple', ['link', 'weight', 'campaign'])
Please sign in to comment.
Something went wrong with that request. Please try again.