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
9d9f0c2f
Commit
9d9f0c2f
authored
Dec 19, 2014
by
Awais
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ECOM-759 if course is none return 404 error code.
parent
708fd87b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
lms/djangoapps/verify_student/tests/test_views.py
+8
-0
lms/djangoapps/verify_student/views.py
+3
-0
No files found.
lms/djangoapps/verify_student/tests/test_views.py
View file @
9d9f0c2f
...
...
@@ -716,6 +716,14 @@ class TestMidCourseReverifyView(ModuleStoreTestCase):
# enrolled in a verified course, and the window is open
self
.
assertEquals
(
response
.
status_code
,
200
)
@patch
(
'verify_student.views.render_to_response'
,
render_mock
)
def
test_midcourse_reverify_invalid_course_id
(
self
):
# if course id is invalid return 400
invalid_course_key
=
CourseLocator
(
'edx'
,
'not'
,
'valid'
)
url
=
reverse
(
'verify_student_midcourse_reverify'
,
kwargs
=
{
'course_id'
:
unicode
(
invalid_course_key
)})
response
=
self
.
client
.
get
(
url
)
self
.
assertEqual
(
response
.
status_code
,
404
)
@override_settings
(
MODULESTORE
=
MODULESTORE_CONFIG
)
class
TestReverificationBanner
(
ModuleStoreTestCase
):
...
...
lms/djangoapps/verify_student/views.py
View file @
9d9f0c2f
...
...
@@ -1061,6 +1061,9 @@ class MidCourseReverifyView(View):
"""
course_id
=
CourseKey
.
from_string
(
course_id
)
course
=
modulestore
()
.
get_course
(
course_id
)
if
course
is
None
:
raise
Http404
course_enrollment
=
CourseEnrollment
.
get_or_create_enrollment
(
request
.
user
,
course_id
)
course_enrollment
.
update_enrollment
(
mode
=
"verified"
)
course_enrollment
.
emit_event
(
EVENT_NAME_USER_ENTERED_MIDCOURSE_REVERIFY_VIEW
)
...
...
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