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
df72f028
Commit
df72f028
authored
Sep 11, 2013
by
jkarni
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #931 from edx/jkarni/fix/itemsavelogging
Add logging to save item
parents
1d668ff9
a29243fc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
cms/djangoapps/contentstore/views/item.py
+21
-0
No files found.
cms/djangoapps/contentstore/views/item.py
View file @
df72f028
import
logging
from
uuid
import
uuid4
from
django.core.exceptions
import
PermissionDenied
from
django.contrib.auth.decorators
import
login_required
from
django.http
import
HttpResponseBadRequest
from
xmodule.modulestore
import
Location
from
xmodule.modulestore.django
import
modulestore
...
...
@@ -18,6 +20,7 @@ __all__ = ['save_item', 'create_item', 'delete_item']
# cdodge: these are categories which should not be parented, they are detached from the hierarchy
DETACHED_CATEGORIES
=
[
'about'
,
'static_tab'
,
'course_info'
]
log
=
logging
.
getLogger
(
__name__
)
@login_required
@expect_json
...
...
@@ -32,7 +35,25 @@ def save_item(request):
"""
# The nullout is a bit of a temporary copout until we can make module_edit.coffee and the metadata editors a
# little smarter and able to pass something more akin to {unset: [field, field]}
try
:
item_location
=
request
.
POST
[
'id'
]
except
KeyError
:
import
inspect
log
.
exception
(
'''Request missing required attribute 'id'.
Request info:
%
s
Caller:
Function
%
s in file
%
s
'''
,
request
.
META
,
inspect
.
currentframe
()
.
f_back
.
f_code
.
co_name
,
inspect
.
currentframe
()
.
f_back
.
f_code
.
co_filename
)
return
HttpResponseBadRequest
()
# check permissions for this user within this course
if
not
has_access
(
request
.
user
,
item_location
):
...
...
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