Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
c3437342
Commit
c3437342
authored
12 years ago
by
Victor Shnayder
Browse files
Options
Downloads
Plain Diff
Merge pull request #183 from MITx/victor/cms_more_auth
Add fixes to notes in #182
parents
f8878279
f8ce11a6
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cms/djangoapps/contentstore/views.py
+10
-8
10 additions, 8 deletions
cms/djangoapps/contentstore/views.py
rakefile
+1
-1
1 addition, 1 deletion
rakefile
with
11 additions
and
9 deletions
cms/djangoapps/contentstore/views.py
+
10
−
8
View file @
c3437342
...
...
@@ -68,12 +68,13 @@ def course_index(request, org, course, name):
@login_required
def
edit_item
(
request
):
# TODO (vshnayder): Why are we using "id" instead of "location"?
item_id
=
request
.
GET
[
'
id
'
]
if
not
has_access
(
request
.
user
,
item_id
):
# TODO (vshnayder): change name from id to location in coffee+html as well.
item_location
=
request
.
GET
[
'
id
'
]
print
item_location
,
request
.
GET
if
not
has_access
(
request
.
user
,
item_location
):
raise
Http404
# TODO (vshnayder): better error
item
=
modulestore
().
get_item
(
item_
id
)
item
=
modulestore
().
get_item
(
item_
location
)
return
render_to_response
(
'
unit.html
'
,
{
'
contents
'
:
item
.
get_html
(),
'
js_module
'
:
item
.
js_module_name
(),
...
...
@@ -100,17 +101,18 @@ def user_author_string(user):
@login_required
@expect_json
def
save_item
(
request
):
item_
id
=
request
.
POST
[
'
id
'
]
if
not
has_access
(
request
.
user
,
item_
id
):
item_
location
=
request
.
POST
[
'
id
'
]
if
not
has_access
(
request
.
user
,
item_
location
):
raise
Http404
# TODO (vshnayder): better error
data
=
json
.
loads
(
request
.
POST
[
'
data
'
])
modulestore
().
update_item
(
item_
id
,
data
)
modulestore
().
update_item
(
item_
location
,
data
)
# Export the course back to github
# This uses wildcarding to find the course, which requires handling
# multiple courses returned, but there should only ever be one
course_location
=
Location
(
item_id
).
_replace
(
category
=
'
course
'
,
name
=
None
)
course_location
=
Location
(
item_location
).
_replace
(
category
=
'
course
'
,
name
=
None
)
courses
=
modulestore
().
get_items
(
course_location
,
depth
=
None
)
for
course
in
courses
:
author_string
=
user_author_string
(
request
.
user
)
...
...
This diff is collapsed.
Click to expand it.
rakefile
+
1
−
1
View file @
c3437342
...
...
@@ -88,7 +88,7 @@ end
# Per System tasks
desc
"Run all django tests on our djangoapps for the
#{
system
}
"
task
"test_
#{
system
}
"
=>
[
"
#{
system
}
:collectstatic:test"
,
"fasttest_
#{
system
}
"
]
task
"test_
#{
system
}
"
=>
[
"
#{
system
}
:collectstatic:test"
,
"fasttest_
#{
system
}
"
]
# Have a way to run the tests without running collectstatic -- useful when debugging without
# messing with static files.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment