Update FPD holdback to 10% for longitudinal analysis (#24037)

REV-1153
This commit is contained in:
julianajlk
2020-05-26 13:16:40 -04:00
committed by GitHub
parent 7341f296a3
commit 565018bd2e

View File

@@ -96,6 +96,9 @@ def can_receive_discount(user, course, discount_expiration_date=None):
return False
# TODO: Add additional conditions to return False here
# Turn holdback on
if _is_in_holdback(user):
return False
# Check if discount has expired
if not discount_expiration_date:
@@ -146,8 +149,8 @@ def _is_in_holdback(user):
if datetime(2020, 8, 1, tzinfo=pytz.UTC) <= datetime.now(tz=pytz.UTC):
return False
# Holdback is 50/50
bucket = stable_bucketing_hash_group(DISCOUNT_APPLICABILITY_HOLDBACK, 2, user.username)
# Holdback is 10%
bucket = stable_bucketing_hash_group(DISCOUNT_APPLICABILITY_HOLDBACK, 10, user.username)
request = get_current_request()
if hasattr(request, 'session') and DISCOUNT_APPLICABILITY_HOLDBACK not in request.session: