Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
f89ae754
Unverified
Commit
f89ae754
authored
3 years ago
by
Matthew Piatetsky
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Revert "feat: add debugging logs to help figure out why experiment isn't activating in production"
parent
58d36e96
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
openedx/core/djangoapps/courseware_api/utils.py
+0
-6
0 additions, 6 deletions
openedx/core/djangoapps/courseware_api/utils.py
openedx/features/discounts/applicability.py
+3
-10
3 additions, 10 deletions
openedx/features/discounts/applicability.py
with
3 additions
and
16 deletions
openedx/core/djangoapps/courseware_api/utils.py
+
0
−
6
View file @
f89ae754
...
...
@@ -2,8 +2,6 @@
Courseware API Mixins.
"""
import
logging
from
babel.numbers
import
get_currency_symbol
from
common.djangoapps.course_modes.models
import
CourseMode
...
...
@@ -13,8 +11,6 @@ from lms.djangoapps.experiments.utils import STREAK_DISCOUNT_EXPERIMENT_FLAG
from
openedx.features.course_duration_limits.access
import
get_user_course_expiration_date
from
openedx.features.discounts.applicability
import
can_show_streak_discount_experiment_coupon
log
=
logging
.
getLogger
(
__name__
)
def
get_celebrations_dict
(
user
,
enrollment
,
course
,
browser_timezone
):
"""
...
...
@@ -38,12 +34,10 @@ def get_celebrations_dict(user, enrollment, course, browser_timezone):
# We only want to bucket people into the AA-759 experiment if they are going to see the streak celebration
if
streak_length_to_celebrate
:
log
.
info
(
'
AA759debug 0
'
)
# We only want to bucket people into the AA-759 experiment
# if the course has not ended, is upgradeable and the user is not an enterprise learner
if
can_show_streak_discount_experiment_coupon
(
user
,
course
):
celebrations
[
'
streak_discount_experiment_enabled
'
]
=
STREAK_DISCOUNT_EXPERIMENT_FLAG
.
is_enabled
()
log
.
info
(
'
AA759debug 8 %s %s
'
,
user
.
username
,
celebrations
[
'
streak_discount_experiment_enabled
'
])
return
celebrations
...
...
This diff is collapsed.
Click to expand it.
openedx/features/discounts/applicability.py
+
3
−
10
View file @
f89ae754
...
...
@@ -11,7 +11,6 @@ not other discounts like coupons or enterprise/program offers configured in ecom
from
datetime
import
datetime
,
timedelta
import
logging
import
pytz
from
crum
import
get_current_request
,
impersonate
from
django.utils
import
timezone
...
...
@@ -45,8 +44,6 @@ DISCOUNT_APPLICABILITY_FLAG = LegacyWaffleFlag(
DISCOUNT_APPLICABILITY_HOLDBACK
=
'
first_purchase_discount_holdback
'
REV1008_EXPERIMENT_ID
=
16
log
=
logging
.
getLogger
(
__name__
)
def
get_discount_expiration_date
(
user
,
course
):
"""
...
...
@@ -54,19 +51,17 @@ def get_discount_expiration_date(user, course):
Returns none if the user is not enrolled.
"""
# anonymous users should never get the discount
log
.
info
(
'
AA759debug 1 %s
'
,
user
.
username
)
if
user
.
is_anonymous
:
return
None
log
.
info
(
'
AA759debug 2 %s
'
,
user
.
username
)
course_enrollment
=
CourseEnrollment
.
objects
.
filter
(
user
=
user
,
course
=
course
.
id
,
mode__in
=
CourseMode
.
UPSELL_TO_VERIFIED_MODES
)
log
.
info
(
'
AA759debug 3 %s
'
,
user
.
username
)
if
len
(
course_enrollment
)
!=
1
:
return
None
log
.
info
(
'
AA759debug 4 %s
'
,
user
.
username
)
time_limit_start
=
None
try
:
saw_banner
=
ExperimentData
.
objects
.
get
(
user
=
user
,
experiment_id
=
REV1008_EXPERIMENT_ID
,
key
=
str
(
course
.
id
))
...
...
@@ -74,7 +69,6 @@ def get_discount_expiration_date(user, course):
except
ExperimentData
.
DoesNotExist
:
return
None
log
.
info
(
'
AA759debug 5 %s
'
,
user
.
username
)
discount_expiration_date
=
time_limit_start
+
timedelta
(
weeks
=
1
)
# If the course has an upgrade deadline and discount time limit would put the discount expiration date
...
...
@@ -82,11 +76,10 @@ def get_discount_expiration_date(user, course):
verified_mode
=
CourseMode
.
verified_mode_for_course
(
course
=
course
,
include_expired
=
True
)
if
not
verified_mode
:
return
None
log
.
info
(
'
AA759debug 6 %s
'
,
user
.
username
)
upgrade_deadline
=
verified_mode
.
expiration_datetime
if
upgrade_deadline
and
discount_expiration_date
>
upgrade_deadline
:
discount_expiration_date
=
upgrade_deadline
log
.
info
(
'
AA759debug 7 %s
'
,
user
.
username
)
return
discount_expiration_date
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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