Merge pull request #16494 from edx/jeskew/remove_autostartup_call_code
Remove everything from CMS/LMS startup.py except single monkey-patch.
This commit is contained in:
@@ -12,3 +12,15 @@ class CommonInitializationConfig(AppConfig):
|
||||
def ready(self):
|
||||
# Common settings validations for the LMS and CMS.
|
||||
from . import checks
|
||||
self._add_mimetypes()
|
||||
|
||||
def _add_mimetypes(self):
|
||||
"""
|
||||
Add extra mimetypes. Used in xblock_resource.
|
||||
"""
|
||||
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')
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
"""
|
||||
Automatic execution of startup modules in Django apps.
|
||||
"""
|
||||
|
||||
from importlib import import_module
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
def autostartup():
|
||||
"""
|
||||
Execute app.startup:run() for all installed django apps
|
||||
"""
|
||||
for app in settings.INSTALLED_APPS:
|
||||
# See if there's a startup module in each app.
|
||||
try:
|
||||
mod = import_module(app + '.startup')
|
||||
except ImportError:
|
||||
continue
|
||||
|
||||
# If the module has a run method, run it.
|
||||
if hasattr(mod, 'run'):
|
||||
mod.run()
|
||||
Reference in New Issue
Block a user