small adjustments to user mod page again
[mediagoblin.git] / mediagoblin / app.py
index 9646171107af66c697e4bcd187d2432c95dfe3d6..e65e6d1044958f992591e2411056fb14697c1dd8 100644 (file)
@@ -25,10 +25,12 @@ from werkzeug.exceptions import HTTPException
 from werkzeug.routing import RequestRedirect
 
 from mediagoblin import meddleware, __version__
+from mediagoblin.db.util import check_db_up_to_date
 from mediagoblin.tools import common, session, translate, template
 from mediagoblin.tools.response import render_http_exception
 from mediagoblin.tools.theme import register_themes
 from mediagoblin.tools import request as mg_request
+from mediagoblin.media_types.tools import media_type_warning
 from mediagoblin.mg_globals import setup_globals
 from mediagoblin.init.celery import setup_celery_from_config
 from mediagoblin.init.plugins import setup_plugins
@@ -38,7 +40,6 @@ from mediagoblin.init import (get_jinja_loader, get_staticdirector,
 from mediagoblin.tools.pluginapi import PluginManager, hook_transform
 from mediagoblin.tools.crypto import setup_crypto
 from mediagoblin.auth.tools import check_auth_enabled, no_auth_logout
-from mediagoblin import notifications
 
 
 _log = logging.getLogger(__name__)
@@ -69,6 +70,8 @@ class MediaGoblinApp(object):
         # Open and setup the config
         global_config, app_config = setup_global_and_app_config(config_path)
 
+        media_type_warning()
+
         setup_crypto()
 
         ##########################################
@@ -87,7 +90,10 @@ class MediaGoblinApp(object):
         setup_plugins()
 
         # Set up the database
-        self.db = setup_database()
+        self.db = setup_database(app_config['run_migrations'])
+
+        # Quit app if need to run dbupdate
+        check_db_up_to_date()
 
         # Register themes
         self.theme_registry, self.current_theme = register_themes(app_config)
@@ -196,8 +202,6 @@ class MediaGoblinApp(object):
         # Log user out if authentication_disabled
         no_auth_logout(request)
 
-        request.notifications = notifications
-
         mg_request.setup_user_in_request(request)
 
         request.controller_name = None