FIXED SQL MIGRATION #2
[mediagoblin.git] / mediagoblin / db / sql / open.py
index 2520bb49b5f2496de2337f37d839617da20c94c1..ce5f06042f8d8f33c95763edf41ebd394bca448f 100644 (file)
@@ -37,6 +37,12 @@ class DatabaseMaster(object):
         Session.add(obj)
         Session.flush()
 
+    def check_session_clean(self):
+        for dummy in Session():
+            _log.warn("STRANGE: There are elements in the sql session. "
+                      "Please report this and help us track this down.")
+            break
+
     def reset_after_request(self):
         Session.rollback()
         Session.remove()
@@ -45,8 +51,7 @@ class DatabaseMaster(object):
 def load_models(app_config):
     import mediagoblin.db.sql.models
 
-    # TODO/Fix: This breaks celery
-    if False:
+    if True:
         for media_type in app_config['media_types']:
             _log.debug("Loading %s.models", media_type)
             __import__(media_type + ".models")