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
8b011d98
Commit
8b011d98
authored
4 years ago
by
Simon Chen
Browse files
Options
Downloads
Patches
Plain Diff
Add logging statements to investigate MST-264
parent
8663b5be
Branches
Branches containing commit
Tags
release-2020-08-26-16.45
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lms/djangoapps/program_enrollments/rest_api/v1/views.py
+19
-0
19 additions, 0 deletions
lms/djangoapps/program_enrollments/rest_api/v1/views.py
with
19 additions
and
0 deletions
lms/djangoapps/program_enrollments/rest_api/v1/views.py
+
19
−
0
View file @
8b011d98
...
...
@@ -2,6 +2,8 @@
"""
ProgramEnrollment Views
"""
import
logging
from
ccx_keys.locator
import
CCXLocator
from
django.conf
import
settings
from
django.core.management
import
call_command
...
...
@@ -71,6 +73,8 @@ from .utils import (
verify_user_enrolled_in_program
)
logger
=
logging
.
getLogger
(
__name__
)
class
EnrollmentWriteMixin
(
object
):
"""
...
...
@@ -707,6 +711,11 @@ class UserProgramReadOnlyAccessView(DeveloperErrorViewMixin, PaginatedAPIView):
programs
=
[]
requested_program_type
=
normalize_program_type
(
request
.
GET
.
get
(
'
type
'
,
self
.
DEFAULT_PROGRAM_TYPE
))
logger
.
info
(
'
User %s is requesting the program_enrollments for learner portal display
'
,
request_user
.
id
,
)
if
request_user
.
is_staff
:
programs
=
get_programs_by_type
(
request
.
site
,
requested_program_type
)
elif
self
.
is_course_staff
(
request_user
):
...
...
@@ -716,7 +725,17 @@ class UserProgramReadOnlyAccessView(DeveloperErrorViewMixin, PaginatedAPIView):
user
=
request
.
user
,
program_enrollment_statuses
=
ProgramEnrollmentStatuses
.
__ACTIVE__
,
)
logger
.
info
(
'
User %s is enrolled into %s programs
'
,
request_user
.
id
,
len
(
program_enrollments
)
)
uuids
=
[
enrollment
.
program_uuid
for
enrollment
in
program_enrollments
]
logger
.
info
(
'
The program UUIDs the user %s is enrolled into are: %s
'
,
request_user
.
id
,
'
,
'
.
join
([
str
(
uuid
)
for
uuid
in
uuids
])
)
programs
=
get_programs
(
uuids
=
uuids
)
or
[]
programs_in_which_user_has_access
=
[
...
...
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