Register the models when using from_celery
authorChristopher Allan Webber <cwebber@dustycloud.org>
Mon, 2 May 2011 00:41:22 +0000 (19:41 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Mon, 2 May 2011 00:41:22 +0000 (19:41 -0500)
mediagoblin/celery_setup/from_celery.py

index 851cbaa1a5196c4e38c8cf8f16544ea76145b53e..9bd7fe07afd2eb7da47474371fbae4ab625e7380 100644 (file)
@@ -19,7 +19,7 @@ import os
 import mongokit
 from paste.deploy.loadwsgi import NicerConfigParser
 
-from mediagoblin import storage
+from mediagoblin import storage, models
 from mediagoblin.celery_setup import setup_celery_from_config
 from mediagoblin.globals import setup_globals
 
@@ -69,6 +69,7 @@ def setup_self(setup_globals_func=setup_globals):
     connection = mongokit.Connection(
         mgoblin_section.get('db_host'), mgoblin_section.get('db_port'))
     db = connection[mgoblin_section.get('db_name', 'mediagoblin')]
+    models.register_models(connection)
 
     # Set up the storage systems.
     public_store = storage.storage_system_from_paste_config(