changeset 517:666147a2cc08

Moved the imports from the top of the file into the task function. This seemed to prevent some strange import errors that only occurred on the production server. I don't know if the problems were related to mod_wsgi or Python 2.5 or what.
author Brian Neal <bgneal@gmail.com>
date Thu, 15 Dec 2011 02:49:16 +0000
parents beda97542da8
children 5171a5e9353b
files gpp/core/tasks.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gpp/core/tasks.py	Thu Dec 15 00:59:32 2011 +0000
+++ b/gpp/core/tasks.py	Thu Dec 15 02:49:16 2011 +0000
@@ -4,8 +4,6 @@
 """
 from celery.task import task
 import django.core.mail
-from django.core.management.commands.cleanup import Command as CleanupCommand
-from forums.management.commands.forum_cleanup import Command as ForumCleanup
 
 
 @task
@@ -33,6 +31,8 @@
     A task to perform site-wide cleanup actions.
 
     """
+    from django.core.management.commands.cleanup import Command as CleanupCommand
+    from forums.management.commands.forum_cleanup import Command as ForumCleanup
     # Execute Django's cleanup command (deletes old sessions).
 
     command = CleanupCommand()