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
a8ec1ca9
Commit
a8ec1ca9
authored
Jun 04, 2013
by
dcadams
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified code such that non-logged in student activates correctly.
parent
1ea65455
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
common/djangoapps/student/views.py
+7
-6
lms/djangoapps/instructor/tests/test_enrollment.py
+1
-1
No files found.
common/djangoapps/student/views.py
View file @
a8ec1ca9
...
...
@@ -912,12 +912,13 @@ def activate_account(request, key):
already_active
=
False
#Enroll student in any pending courses he/she may have if auto_enroll flag is set
student
=
request
.
user
ceas
=
CourseEnrollmentAllowed
.
objects
.
filter
(
email
=
student
.
email
)
for
cea
in
ceas
:
if
cea
.
auto_enroll
:
course_id
=
cea
.
course_id
enrollment
,
created
=
CourseEnrollment
.
objects
.
get_or_create
(
user_id
=
student
.
id
,
course_id
=
course_id
)
student
=
User
.
objects
.
filter
(
id
=
r
[
0
]
.
user_id
)
if
student
:
ceas
=
CourseEnrollmentAllowed
.
objects
.
filter
(
email
=
student
[
0
]
.
email
)
for
cea
in
ceas
:
if
cea
.
auto_enroll
:
course_id
=
cea
.
course_id
enrollment
,
created
=
CourseEnrollment
.
objects
.
get_or_create
(
user_id
=
student
[
0
]
.
id
,
course_id
=
course_id
)
resp
=
render_to_response
(
"registration/activation_complete.html"
,
{
'user_logged_in'
:
user_logged_in
,
'already_active'
:
already_active
})
return
resp
...
...
lms/djangoapps/instructor/tests/test_enrollment.py
View file @
a8ec1ca9
...
...
@@ -81,7 +81,7 @@ class TestInstructorEnrollsStudent(LoginEnrollmentTestCase):
ce
=
CourseEnrollment
.
objects
.
filter
(
course_id
=
course
.
id
,
user
=
user
)
self
.
assertEqual
(
0
,
len
(
ce
))
def
test_enrollme
m
t_new_student_autoenroll_on
(
self
):
def
test_enrollme
n
t_new_student_autoenroll_on
(
self
):
'''
Do auto-enroll on test
'''
...
...
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