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
a29243fc
Commit
a29243fc
authored
Aug 15, 2013
by
Julian Arni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add logging to save item
parent
f4fe6de3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletions
+22
-1
cms/djangoapps/contentstore/views/item.py
+22
-1
No files found.
cms/djangoapps/contentstore/views/item.py
View file @
a29243fc
import
logging
from
uuid
import
uuid4
from
uuid
import
uuid4
from
django.core.exceptions
import
PermissionDenied
from
django.core.exceptions
import
PermissionDenied
from
django.contrib.auth.decorators
import
login_required
from
django.contrib.auth.decorators
import
login_required
from
django.http
import
HttpResponseBadRequest
from
xmodule.modulestore
import
Location
from
xmodule.modulestore
import
Location
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.django
import
modulestore
...
@@ -18,6 +20,7 @@ __all__ = ['save_item', 'create_item', 'delete_item']
...
@@ -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
# cdodge: these are categories which should not be parented, they are detached from the hierarchy
DETACHED_CATEGORIES
=
[
'about'
,
'static_tab'
,
'course_info'
]
DETACHED_CATEGORIES
=
[
'about'
,
'static_tab'
,
'course_info'
]
log
=
logging
.
getLogger
(
__name__
)
@login_required
@login_required
@expect_json
@expect_json
...
@@ -32,7 +35,25 @@ def save_item(request):
...
@@ -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
# 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]}
# little smarter and able to pass something more akin to {unset: [field, field]}
item_location
=
request
.
POST
[
'id'
]
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
# check permissions for this user within this course
if
not
has_access
(
request
.
user
,
item_location
):
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