# HG changeset patch # User Brian Neal # Date 1323917356 0 # Node ID 666147a2cc0893ef4b88c27539c41fdfa40fb09d # Parent beda97542da8393e01e4b3bdb3131476cc3b6e8c 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. diff -r beda97542da8 -r 666147a2cc08 gpp/core/tasks.py --- 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()