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
4c15dd93
Commit
4c15dd93
authored
Apr 13, 2016
by
attiyaishaque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Course export page will not be opened for course id that does not belong to any course.
parent
069e884f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletions
+15
-1
cms/djangoapps/contentstore/views/import_export.py
+3
-1
cms/djangoapps/contentstore/views/tests/test_import_export.py
+12
-0
No files found.
cms/djangoapps/contentstore/views/import_export.py
View file @
4c15dd93
...
...
@@ -16,7 +16,7 @@ from django.contrib.auth.decorators import login_required
from
django.core.exceptions
import
SuspiciousOperation
,
PermissionDenied
from
django.core.files.temp
import
NamedTemporaryFile
from
django.core.servers.basehttp
import
FileWrapper
from
django.http
import
HttpResponse
,
HttpResponseNotFound
from
django.http
import
HttpResponse
,
HttpResponseNotFound
,
Http404
from
django.utils.translation
import
ugettext
as
_
from
django.views.decorators.csrf
import
ensure_csrf_cookie
from
django.views.decorators.http
import
require_http_methods
,
require_GET
...
...
@@ -489,6 +489,8 @@ def export_handler(request, course_key_string):
}
else
:
courselike_module
=
modulestore
()
.
get_course
(
course_key
)
if
courselike_module
is
None
:
raise
Http404
context
=
{
'context_course'
:
courselike_module
,
'courselike_home_url'
:
reverse_course_url
(
"course_handler"
,
course_key
),
...
...
cms/djangoapps/contentstore/views/tests/test_import_export.py
View file @
4c15dd93
...
...
@@ -510,6 +510,7 @@ class ImportTestCase(CourseTestCase):
@override_settings
(
CONTENTSTORE
=
TEST_DATA_CONTENTSTORE
)
@ddt.ddt
class
ExportTestCase
(
CourseTestCase
):
"""
Tests for export_handler.
...
...
@@ -630,6 +631,17 @@ class ExportTestCase(CourseTestCase):
self
.
test_export_targz_urlparam
()
@ddt.data
(
'/export/non.1/existence_1/Run_1'
,
# For mongo
'/export/course-v1:non1+existence1+Run1'
,
# For split
)
def
test_export_course_doest_not_exist
(
self
,
url
):
"""
Export failure if course is not exist
"""
resp
=
self
.
client
.
get_html
(
url
)
self
.
assertEquals
(
resp
.
status_code
,
404
)
@override_settings
(
CONTENTSTORE
=
TEST_DATA_CONTENTSTORE
)
class
TestLibraryImportExport
(
CourseTestCase
):
...
...
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