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
2d026d58
Commit
2d026d58
authored
Sep 08, 2017
by
Noraiz Anwar
Committed by
GitHub
Sep 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "EDUCATOR-1267 Add logs in importing the course."
parent
91ac9751
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
32 deletions
+1
-32
cms/djangoapps/contentstore/views/import_export.py
+1
-32
No files found.
cms/djangoapps/contentstore/views/import_export.py
View file @
2d026d58
...
...
@@ -8,7 +8,6 @@ import logging
import
os
import
re
import
shutil
import
socket
from
django.conf
import
settings
from
django.contrib.auth.decorators
import
login_required
...
...
@@ -161,16 +160,6 @@ def _write_chunk(request, courselike_key):
# This shouldn't happen, even if different instances are handling
# the same session, but it's always better to catch errors earlier.
if
size
<
int
(
content_range
[
'start'
]):
log
.
warning
(
u"Course uploading failed. "
u"course_id: {}, file_path: {}, range: {}, server: {}, session_key: {} "
.
format
(
courselike_key
,
temp_filepath
if
temp_filepath
.
exists
()
else
'EMPTY'
,
content_range
[
'start'
],
socket
.
gethostname
(),
request
.
session
.
session_key
,
)
)
_save_request_status
(
request
,
courselike_string
,
-
1
)
log
.
warning
(
"Reported range
%
s does not match size downloaded so far
%
s"
,
...
...
@@ -188,16 +177,7 @@ def _write_chunk(request, courselike_key):
# nginx sends a 499 error code when the response takes too long.
elif
size
>
int
(
content_range
[
'stop'
])
and
size
==
int
(
content_range
[
'end'
]):
return
JsonResponse
({
'ImportStatus'
:
1
})
log
.
info
(
u"Uploading course :"
u"course_id: {}, file_path: {}, range: {}, server: {}, session_key: {} "
.
format
(
courselike_key
,
temp_filepath
,
content_range
[
'start'
],
socket
.
gethostname
(),
request
.
session
.
session_key
,
)
)
with
open
(
temp_filepath
,
mode
)
as
temp_file
:
for
chunk
in
request
.
FILES
[
'course-data'
]
.
chunks
():
temp_file
.
write
(
chunk
)
...
...
@@ -234,17 +214,6 @@ def _write_chunk(request, courselike_key):
log
.
exception
(
"error importing course"
)
log
.
warning
(
u"Course uploading failed. "
u"course_id: {}, file_path: {}, range: {}, server: {}, session_key: {} "
.
format
(
courselike_key
,
temp_filepath
,
content_range
[
'start'
],
socket
.
gethostname
(),
request
.
session
.
session_key
,
)
)
return
JsonResponse
(
{
'ErrMsg'
:
str
(
exception
),
...
...
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