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
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
ed409563
Unverified
Commit
ed409563
authored
6 years ago
by
Matthew Piatetsky
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #18779 from edx/update_mobile_exclusion
update mobile exclusion
parents
38d74679
e756d002
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lms/djangoapps/mobile_api/users/views.py
+9
-6
9 additions, 6 deletions
lms/djangoapps/mobile_api/users/views.py
with
9 additions
and
6 deletions
lms/djangoapps/mobile_api/users/views.py
+
9
−
6
View file @
ed409563
...
...
@@ -275,19 +275,22 @@ class UserCourseEnrollmentsList(generics.ListAPIView):
"""
return
check_org
is
None
or
(
check_org
.
lower
()
==
course_org
.
lower
())
def
hide_course_for_enrollment_fee_experiment
(
self
,
user
,
course_key
,
experiment_id
=
9
):
def
hide_course_for_enrollment_fee_experiment
(
self
,
user
,
enrollment
,
experiment_id
=
9
):
"""
Hide enrolled courses from mobile app as part of REV-73/REV-19
"""
course_key
=
enrollment
.
course_overview
.
id
try
:
courses_excluded_from_mobile
=
ExperimentKeyValue
.
objects
.
get
(
experiment_id
=
10
,
key
=
"
excluded_from_
mobile_app
"
key
=
"
mobile_app
_exclusion
"
).
value
courses_excluded_from_mobile
=
json
.
loads
(
courses_excluded_from_mobile
.
replace
(
'
\r
'
,
''
).
replace
(
'
\n
'
,
''
))
if
str
(
course_key
)
in
courses_excluded_from_mobile
:
return
True
except
ExperimentKeyValue
.
DoesNotExist
:
if
enrollment
.
mode
==
'
audit
'
and
str
(
course_key
)
in
courses_excluded_from_mobile
.
keys
():
activationTime
=
dateparse
.
parse_datetime
(
courses_excluded_from_mobile
[
str
(
course_key
)])
if
enrollment
.
created
>
activationTime
:
return
True
except
(
ExperimentKeyValue
.
DoesNotExist
,
AttributeError
):
pass
try
:
...
...
@@ -320,7 +323,7 @@ class UserCourseEnrollmentsList(generics.ListAPIView):
enrollment
for
enrollment
in
enrollments
if
enrollment
.
course_overview
and
self
.
is_org
(
org
,
enrollment
.
course_overview
.
org
)
and
is_mobile_available_for_user
(
self
.
request
.
user
,
enrollment
.
course_overview
)
and
not
self
.
hide_course_for_enrollment_fee_experiment
(
self
.
request
.
user
,
enrollment
.
course_overview
.
id
)
not
self
.
hide_course_for_enrollment_fee_experiment
(
self
.
request
.
user
,
enrollment
)
]
...
...
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