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
63bc8c96
Commit
63bc8c96
authored
Nov 25, 2013
by
Julia Hansbrough
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1771 from edx/flowerhack/fix/lms-1526
Update mode appropriately when user enrolls
parents
c023797b
e4ebb586
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletions
+9
-1
common/djangoapps/student/models.py
+1
-1
common/djangoapps/student/tests/tests.py
+8
-0
No files found.
common/djangoapps/student/models.py
View file @
63bc8c96
...
...
@@ -825,7 +825,7 @@ class CourseEnrollment(models.Model):
verified the user authentication and access.
"""
enrollment
=
cls
.
get_or_create_enrollment
(
user
,
course_id
)
enrollment
.
update_enrollment
(
is_active
=
True
)
enrollment
.
update_enrollment
(
is_active
=
True
,
mode
=
mode
)
return
enrollment
@classmethod
...
...
common/djangoapps/student/tests/tests.py
View file @
63bc8c96
...
...
@@ -342,6 +342,14 @@ class EnrollInCourseTest(TestCase):
)
self
.
assertFalse
(
enrollment_record
.
is_active
)
# Make sure mode is updated properly if user unenrolls & re-enrolls
enrollment
=
CourseEnrollment
.
enroll
(
user
,
course_id
,
"verified"
)
self
.
assertEquals
(
enrollment
.
mode
,
"verified"
)
CourseEnrollment
.
unenroll
(
user
,
course_id
)
enrollment
=
CourseEnrollment
.
enroll
(
user
,
course_id
,
"audit"
)
self
.
assertTrue
(
CourseEnrollment
.
is_enrolled
(
user
,
course_id
))
self
.
assertEquals
(
enrollment
.
mode
,
"audit"
)
def
assert_no_events_were_emitted
(
self
):
"""Ensures no events were emitted since the last event related assertion"""
self
.
assertFalse
(
self
.
mock_server_track
.
called
)
...
...
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