Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
2157202a
Commit
2157202a
authored
Nov 14, 2016
by
Ahsan Ulhaq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add log info for course enrollment
ECOM-4763
parent
b65d245b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
common/djangoapps/enrollment/views.py
+5
-1
No files found.
common/djangoapps/enrollment/views.py
View file @
2157202a
...
@@ -616,13 +616,14 @@ class EnrollmentListView(APIView, ApiKeyPermissionMixIn):
...
@@ -616,13 +616,14 @@ class EnrollmentListView(APIView, ApiKeyPermissionMixIn):
org
=
course_id
.
org
org
=
course_id
.
org
update_email_opt_in
(
request
.
user
,
org
,
email_opt_in
)
update_email_opt_in
(
request
.
user
,
org
,
email_opt_in
)
log
.
info
(
'The user [
%
s] has already been enrolled in course run [
%
s].'
,
username
,
course_id
)
return
Response
(
response
)
return
Response
(
response
)
except
CourseModeNotFoundError
as
error
:
except
CourseModeNotFoundError
as
error
:
return
Response
(
return
Response
(
status
=
status
.
HTTP_400_BAD_REQUEST
,
status
=
status
.
HTTP_400_BAD_REQUEST
,
data
=
{
data
=
{
"message"
:
(
"message"
:
(
u"The
course mode '{mode}' is not available for course '{course_id}'
."
u"The
[{mode}] course mode is expired or otherwise unavailable for course run [{course_id}]
."
)
.
format
(
mode
=
mode
,
course_id
=
course_id
),
)
.
format
(
mode
=
mode
,
course_id
=
course_id
),
"course_details"
:
error
.
data
"course_details"
:
error
.
data
})
})
...
@@ -634,8 +635,11 @@ class EnrollmentListView(APIView, ApiKeyPermissionMixIn):
...
@@ -634,8 +635,11 @@ class EnrollmentListView(APIView, ApiKeyPermissionMixIn):
}
}
)
)
except
CourseEnrollmentExistsError
as
error
:
except
CourseEnrollmentExistsError
as
error
:
log
.
warning
(
'An enrollment already exists for user [
%
s] in course run [
%
s].'
,
username
,
course_id
)
return
Response
(
data
=
error
.
enrollment
)
return
Response
(
data
=
error
.
enrollment
)
except
CourseEnrollmentError
:
except
CourseEnrollmentError
:
log
.
exception
(
"An error occurred while creating the new course enrollment for user "
"[
%
s] in course run [
%
s]"
,
username
,
course_id
)
return
Response
(
return
Response
(
status
=
status
.
HTTP_400_BAD_REQUEST
,
status
=
status
.
HTTP_400_BAD_REQUEST
,
data
=
{
data
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment