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
27cd9c9f
Commit
27cd9c9f
authored
Sep 20, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused 'module' parameter from replace_{static,course}_urls
parent
4a162dad
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
+5
-6
cms/djangoapps/contentstore/views.py
+1
-1
common/djangoapps/xmodule_modifiers.py
+2
-2
lms/djangoapps/courseware/module_render.py
+2
-3
No files found.
cms/djangoapps/contentstore/views.py
View file @
27cd9c9f
...
@@ -247,7 +247,7 @@ def load_preview_module(request, preview_id, descriptor, instance_state, shared_
...
@@ -247,7 +247,7 @@ def load_preview_module(request, preview_id, descriptor, instance_state, shared_
module
=
descriptor
.
xmodule_constructor
(
system
)(
instance_state
,
shared_state
)
module
=
descriptor
.
xmodule_constructor
(
system
)(
instance_state
,
shared_state
)
module
.
get_html
=
replace_static_urls
(
module
.
get_html
=
replace_static_urls
(
wrap_xmodule
(
module
.
get_html
,
module
,
"xmodule_display.html"
),
wrap_xmodule
(
module
.
get_html
,
module
,
"xmodule_display.html"
),
module
.
metadata
[
'data_dir'
]
,
module
module
.
metadata
[
'data_dir'
]
)
)
save_preview_state
(
request
,
preview_id
,
descriptor
.
location
.
url
(),
save_preview_state
(
request
,
preview_id
,
descriptor
.
location
.
url
(),
module
.
get_instance_state
(),
module
.
get_shared_state
())
module
.
get_instance_state
(),
module
.
get_shared_state
())
...
...
common/djangoapps/xmodule_modifiers.py
View file @
27cd9c9f
...
@@ -35,7 +35,7 @@ def wrap_xmodule(get_html, module, template):
...
@@ -35,7 +35,7 @@ def wrap_xmodule(get_html, module, template):
return
_get_html
return
_get_html
def
replace_course_urls
(
get_html
,
course_id
,
module
):
def
replace_course_urls
(
get_html
,
course_id
):
"""
"""
Updates the supplied module with a new get_html function that wraps
Updates the supplied module with a new get_html function that wraps
the old get_html function and substitutes urls of the form /course/...
the old get_html function and substitutes urls of the form /course/...
...
@@ -46,7 +46,7 @@ def replace_course_urls(get_html, course_id, module):
...
@@ -46,7 +46,7 @@ def replace_course_urls(get_html, course_id, module):
return
replace_urls
(
get_html
(),
staticfiles_prefix
=
'/courses/'
+
course_id
,
replace_prefix
=
'/course/'
)
return
replace_urls
(
get_html
(),
staticfiles_prefix
=
'/courses/'
+
course_id
,
replace_prefix
=
'/course/'
)
return
_get_html
return
_get_html
def
replace_static_urls
(
get_html
,
prefix
,
module
):
def
replace_static_urls
(
get_html
,
prefix
):
"""
"""
Updates the supplied module with a new get_html function that wraps
Updates the supplied module with a new get_html function that wraps
the old get_html function and substitutes urls of the form /static/...
the old get_html function and substitutes urls of the form /static/...
...
...
lms/djangoapps/courseware/module_render.py
View file @
27cd9c9f
...
@@ -254,12 +254,11 @@ def _get_module(user, request, location, student_module_cache, course_id, positi
...
@@ -254,12 +254,11 @@ def _get_module(user, request, location, student_module_cache, course_id, positi
module
.
get_html
=
replace_static_urls
(
module
.
get_html
=
replace_static_urls
(
wrap_xmodule
(
module
.
get_html
,
module
,
'xmodule_display.html'
),
wrap_xmodule
(
module
.
get_html
,
module
,
'xmodule_display.html'
),
module
.
metadata
[
'data_dir'
],
module
module
.
metadata
[
'data_dir'
])
)
# Allow URLs of the form '/course/' refer to the root of multicourse directory
# Allow URLs of the form '/course/' refer to the root of multicourse directory
# hierarchy of this course
# hierarchy of this course
module
.
get_html
=
replace_course_urls
(
module
.
get_html
,
course_id
,
module
)
module
.
get_html
=
replace_course_urls
(
module
.
get_html
,
course_id
)
if
settings
.
MITX_FEATURES
.
get
(
'DISPLAY_HISTOGRAMS_TO_STAFF'
):
if
settings
.
MITX_FEATURES
.
get
(
'DISPLAY_HISTOGRAMS_TO_STAFF'
):
if
has_access
(
user
,
module
,
'staff'
):
if
has_access
(
user
,
module
,
'staff'
):
...
...
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