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
3f2cd706
Commit
3f2cd706
authored
Mar 23, 2015
by
Will Daly
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7437 from edx/will/ecom-1229
Course info page no longer creates enrollments.
parents
ec6cc04b
704e8836
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
lms/djangoapps/courseware/tests/test_course_info.py
+15
-0
lms/djangoapps/courseware/views.py
+6
-6
No files found.
lms/djangoapps/courseware/tests/test_course_info.py
View file @
3f2cd706
...
@@ -9,6 +9,7 @@ from opaque_keys.edx.locations import SlashSeparatedCourseKey
...
@@ -9,6 +9,7 @@ from opaque_keys.edx.locations import SlashSeparatedCourseKey
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
TEST_DATA_MIXED_CLOSED_MODULESTORE
from
xmodule.modulestore.tests.django_utils
import
TEST_DATA_MIXED_CLOSED_MODULESTORE
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
student.models
import
CourseEnrollment
from
.helpers
import
LoginEnrollmentTestCase
from
.helpers
import
LoginEnrollmentTestCase
...
@@ -45,6 +46,20 @@ class CourseInfoTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -45,6 +46,20 @@ class CourseInfoTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertNotIn
(
"OOGIE BLOOGIE"
,
resp
.
content
)
self
.
assertNotIn
(
"OOGIE BLOOGIE"
,
resp
.
content
)
def
test_logged_in_not_enrolled
(
self
):
self
.
setup_user
()
url
=
reverse
(
'info'
,
args
=
[
self
.
course
.
id
.
to_deprecated_string
()])
self
.
client
.
get
(
url
)
# Check whether the user has been enrolled in the course.
# There was a bug in which users would be automatically enrolled
# with is_active=False (same as if they enrolled and immediately unenrolled).
# This verifies that the user doesn't have *any* enrollment record.
enrollment_exists
=
CourseEnrollment
.
objects
.
filter
(
user
=
self
.
user
,
course_id
=
self
.
course
.
id
)
.
exists
()
self
.
assertFalse
(
enrollment_exists
)
class
CourseInfoTestCaseXML
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
class
CourseInfoTestCaseXML
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
"""
"""
...
...
lms/djangoapps/courseware/views.py
View file @
3f2cd706
...
@@ -665,7 +665,6 @@ def course_info(request, course_id):
...
@@ -665,7 +665,6 @@ def course_info(request, course_id):
Assumes the course_id is in a valid format.
Assumes the course_id is in a valid format.
"""
"""
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_id
)
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_id
)
with
modulestore
()
.
bulk_operations
(
course_key
):
with
modulestore
()
.
bulk_operations
(
course_key
):
...
@@ -1078,11 +1077,12 @@ def fetch_reverify_banner_info(request, course_key):
...
@@ -1078,11 +1077,12 @@ def fetch_reverify_banner_info(request, course_key):
user
=
request
.
user
user
=
request
.
user
if
not
user
.
id
:
if
not
user
.
id
:
return
reverifications
return
reverifications
enrollment
=
CourseEnrollment
.
get_or_create_enrollment
(
request
.
user
,
course_key
)
enrollment
=
CourseEnrollment
.
get_enrollment
(
request
.
user
,
course_key
)
course
=
modulestore
()
.
get_course
(
course_key
)
if
enrollment
is
not
None
:
info
=
single_course_reverification_info
(
user
,
course
,
enrollment
)
course
=
modulestore
()
.
get_course
(
course_key
)
if
info
:
info
=
single_course_reverification_info
(
user
,
course
,
enrollment
)
reverifications
[
info
.
status
]
.
append
(
info
)
if
info
:
reverifications
[
info
.
status
]
.
append
(
info
)
return
reverifications
return
reverifications
...
...
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