From 565018bd2e2c3005b49e637e6d4be6f9bc19dc50 Mon Sep 17 00:00:00 2001 From: julianajlk Date: Tue, 26 May 2020 13:16:40 -0400 Subject: [PATCH] Update FPD holdback to 10% for longitudinal analysis (#24037) REV-1153 --- openedx/features/discounts/applicability.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openedx/features/discounts/applicability.py b/openedx/features/discounts/applicability.py index 3c25813b0d..81c5a3249a 100644 --- a/openedx/features/discounts/applicability.py +++ b/openedx/features/discounts/applicability.py @@ -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: