comparison gpp/core/tasks.py @ 518:5171a5e9353b

For #194, add a celery task for purging deleted private messages.
author Brian Neal <bgneal@gmail.com>
date Fri, 16 Dec 2011 01:17:35 +0000
parents 666147a2cc08
children f72ace06658a
comparison
equal deleted inserted replaced
517:666147a2cc08 518:5171a5e9353b
29 def cleanup(): 29 def cleanup():
30 """ 30 """
31 A task to perform site-wide cleanup actions. 31 A task to perform site-wide cleanup actions.
32 32
33 """ 33 """
34 # These imports, when placed at the top of the module, caused all kinds of
35 # import problems when running on the production server (Python 2.5 and
36 # mod_wsgi). Moving them here worked around that problem.
37
34 from django.core.management.commands.cleanup import Command as CleanupCommand 38 from django.core.management.commands.cleanup import Command as CleanupCommand
35 from forums.management.commands.forum_cleanup import Command as ForumCleanup 39 from forums.management.commands.forum_cleanup import Command as ForumCleanup
40
36 # Execute Django's cleanup command (deletes old sessions). 41 # Execute Django's cleanup command (deletes old sessions).
37 42
38 command = CleanupCommand() 43 command = CleanupCommand()
39 command.execute() 44 command.execute()
40 45