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
177e8a24
Commit
177e8a24
authored
Jul 10, 2014
by
Julia Hansbrough
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3858 from aboudreault/xblock-resource-missing-mimetypes
Add missing mimetypes for xblock resources
parents
d7e6f94a
031ac985
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
1 deletions
+47
-1
cms/startup.py
+16
-0
lms/djangoapps/courseware/module_render.py
+0
-1
lms/startup.py
+16
-0
lms/tests.py
+15
-0
No files found.
cms/startup.py
View file @
177e8a24
...
@@ -14,3 +14,19 @@ def run():
...
@@ -14,3 +14,19 @@ def run():
Executed during django startup
Executed during django startup
"""
"""
autostartup
()
autostartup
()
add_mimetypes
()
def
add_mimetypes
():
"""
Add extra mimetypes. Used in xblock_resource.
If you add a mimetype here, be sure to also add it in lms/startup.py.
"""
import
mimetypes
mimetypes
.
add_type
(
'application/vnd.ms-fontobject'
,
'.eot'
)
mimetypes
.
add_type
(
'application/x-font-opentype'
,
'.otf'
)
mimetypes
.
add_type
(
'application/x-font-ttf'
,
'.ttf'
)
mimetypes
.
add_type
(
'application/font-woff'
,
'.woff'
)
lms/djangoapps/courseware/module_render.py
View file @
177e8a24
...
@@ -63,7 +63,6 @@ XQUEUE_INTERFACE = XQueueInterface(
...
@@ -63,7 +63,6 @@ XQUEUE_INTERFACE = XQueueInterface(
# Some brave person should make the variable names consistently someday, but the code's
# Some brave person should make the variable names consistently someday, but the code's
# coupled enough that it's kind of tricky--you've been warned!
# coupled enough that it's kind of tricky--you've been warned!
class
LmsModuleRenderError
(
Exception
):
class
LmsModuleRenderError
(
Exception
):
"""
"""
An exception class for exceptions thrown by module_render that don't fit well elsewhere
An exception class for exceptions thrown by module_render that don't fit well elsewhere
...
...
lms/startup.py
View file @
177e8a24
...
@@ -20,6 +20,8 @@ def run():
...
@@ -20,6 +20,8 @@ def run():
"""
"""
autostartup
()
autostartup
()
add_mimetypes
()
if
settings
.
FEATURES
.
get
(
'USE_CUSTOM_THEME'
,
False
):
if
settings
.
FEATURES
.
get
(
'USE_CUSTOM_THEME'
,
False
):
enable_theme
()
enable_theme
()
...
@@ -30,6 +32,20 @@ def run():
...
@@ -30,6 +32,20 @@ def run():
enable_third_party_auth
()
enable_third_party_auth
()
def
add_mimetypes
():
"""
Add extra mimetypes. Used in xblock_resource.
If you add a mimetype here, be sure to also add it in cms/startup.py.
"""
import
mimetypes
mimetypes
.
add_type
(
'application/vnd.ms-fontobject'
,
'.eot'
)
mimetypes
.
add_type
(
'application/x-font-opentype'
,
'.otf'
)
mimetypes
.
add_type
(
'application/x-font-ttf'
,
'.ttf'
)
mimetypes
.
add_type
(
'application/font-woff'
,
'.woff'
)
def
enable_theme
():
def
enable_theme
():
"""
"""
Enable the settings for a custom theme, whose files should be stored
Enable the settings for a custom theme, whose files should be stored
...
...
lms/tests.py
View file @
177e8a24
"""Tests for the lms module itself."""
"""Tests for the lms module itself."""
import
mimetypes
from
django.test
import
TestCase
from
django.test
import
TestCase
from
edxmako
import
add_lookup
,
LOOKUP
from
edxmako
import
add_lookup
,
LOOKUP
from
lms
import
startup
from
lms
import
startup
class
LmsModuleTests
(
TestCase
):
"""
Tests for lms module itself.
"""
def
test_new_mimetypes
(
self
):
extensions
=
[
'eot'
,
'otf'
,
'ttf'
,
'woff'
]
for
extension
in
extensions
:
mimetype
,
_
=
mimetypes
.
guess_type
(
'test.'
+
extension
)
self
.
assertIsNotNone
(
mimetype
)
class
TemplateLookupTests
(
TestCase
):
class
TemplateLookupTests
(
TestCase
):
"""
"""
Tests for TemplateLookup.
Tests for TemplateLookup.
...
...
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