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
b5cb1264
Commit
b5cb1264
authored
Sep 23, 2015
by
Nimisha Asthagiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! course_api
parent
505efe02
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
8 deletions
+13
-8
lms/djangoapps/course_api/blocks/forms.py
+1
-1
lms/djangoapps/course_api/blocks/serializers.py
+1
-1
lms/djangoapps/course_api/blocks/tests/test_views.py
+6
-0
lms/envs/dev.py
+5
-0
lms/envs/devstack.py
+0
-6
No files found.
lms/djangoapps/course_api/blocks/forms.py
View file @
b5cb1264
...
...
@@ -92,7 +92,7 @@ class BlockListGetForm(Form):
try
:
requested_user
=
User
.
objects
.
get
(
username
=
requested_username
)
except
(
User
.
DoesNotExist
):
raise
Http404
(
"'{username}' does not exist."
.
format
(
username
=
requested_username
))
raise
Http404
(
"
Requested user
'{username}' does not exist."
.
format
(
username
=
requested_username
))
# verify whether the requested user's blocks can be accessed
if
not
can_access_users_blocks
(
requested_user
,
course_key
):
...
...
lms/djangoapps/course_api/blocks/serializers.py
View file @
b5cb1264
...
...
@@ -53,7 +53,7 @@ class BlockSerializer(serializers.Serializer):
if
'children'
in
self
.
context
[
'requested_fields'
]:
children
=
self
.
context
[
'block_structure'
]
.
get_children
(
block_key
)
if
children
:
data
[
'children'
]
=
children
data
[
'children'
]
=
[
unicode
(
child
)
for
child
in
children
]
return
data
...
...
lms/djangoapps/course_api/blocks/tests/test_views.py
View file @
b5cb1264
...
...
@@ -131,3 +131,9 @@ class TestCourseBlocksView(ModuleStoreTestCase):
self
.
assert_in_iff
(
'format'
,
block_data
,
xblock
.
format
is
not
None
)
self
.
assert_true_iff
(
block_data
[
'student_view_multi_device'
],
block_data
[
'type'
]
==
'html'
)
self
.
assertNotIn
(
'not_a_field'
,
block_data
)
if
xblock
.
has_children
:
self
.
assertSetEqual
(
set
(
unicode
(
child
.
location
)
for
child
in
xblock
.
get_children
()),
set
(
block_data
[
'children'
]),
)
lms/envs/dev.py
View file @
b5cb1264
...
...
@@ -97,6 +97,11 @@ CACHES = {
'BACKEND'
:
'django.core.cache.backends.locmem.LocMemCache'
,
'LOCATION'
:
'edx_course_structure_mem_cache'
,
},
'lms.course_blocks'
:
{
'BACKEND'
:
'django.core.cache.backends.locmem.LocMemCache'
,
'KEY_FUNCTION'
:
'util.memcache.safe_key'
,
'LOCATION'
:
'lms_course_blocks_cache'
,
},
}
...
...
lms/envs/devstack.py
View file @
b5cb1264
...
...
@@ -234,9 +234,3 @@ SECRET_KEY = '85920908f28904ed733fe576320db18cabd7b6cd'
#####################################################################
# Mobile
FEATURES
[
'ENABLE_RENDER_XBLOCK_API'
]
=
True
CACHES
[
'lms.course_blocks'
]
=
{
'BACKEND'
:
'django.core.cache.backends.locmem.LocMemCache'
,
'KEY_FUNCTION'
:
'util.memcache.safe_key'
,
}
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