Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
code.vt.edu will be down for maintenance from 0530-0630 EDT Wednesday, March 26th
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
565018bd
Unverified
Commit
565018bd
authored
4 years ago
by
julianajlk
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update FPD holdback to 10% for longitudinal analysis (#24037)
REV-1153
parent
7341f296
Branches
Branches containing commit
Tags
release-2020-05-26-15.05
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openedx/features/discounts/applicability.py
+5
-2
5 additions, 2 deletions
openedx/features/discounts/applicability.py
with
5 additions
and
2 deletions
openedx/features/discounts/applicability.py
+
5
−
2
View file @
565018bd
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment