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
e8cd1257
Commit
e8cd1257
authored
Oct 12, 2012
by
Carlos Andrés Rocha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix to read utf-8 enconded html files for custom course tabs
parent
619e9f18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
lms/djangoapps/courseware/tabs.py
+5
-1
No files found.
lms/djangoapps/courseware/tabs.py
View file @
e8cd1257
...
...
@@ -11,10 +11,13 @@ actually generates the CourseTab.
from
collections
import
namedtuple
import
logging
import
codecs
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
fs.errors
import
ResourceNotFoundError
from
courseware.access
import
has_access
from
static_replace
import
replace_urls
...
...
@@ -266,7 +269,8 @@ def get_static_tab_contents(course, tab):
try
:
with
fs
.
open
(
p
)
as
tabfile
:
# TODO: redundant with module_render.py. Want to be helper methods in static_replace or something.
contents
=
replace_urls
(
tabfile
.
read
(),
course
.
metadata
[
'data_dir'
])
text
=
tabfile
.
read
()
.
decode
(
'utf-8'
)
contents
=
replace_urls
(
text
,
course
.
metadata
[
'data_dir'
])
return
replace_urls
(
contents
,
staticfiles_prefix
=
'/courses/'
+
course
.
id
,
replace_prefix
=
'/course/'
)
except
(
ResourceNotFoundError
)
as
err
:
log
.
exception
(
"Couldn't load tab contents from '{0}': {1}"
.
format
(
p
,
err
))
...
...
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