Moved service enable/disable functions to the update_access() function on the user profile

This will remove the need for the cronjob, but not totally, best still to run the cronjob to catch situations where the permission changes can be missed.
This commit is contained in:
2010-03-24 14:52:08 +00:00
parent 337036247e
commit 07450ca5dd
4 changed files with 41 additions and 35 deletions

View File

@@ -2,12 +2,13 @@
"""Executes a Django cronjob"""
import sys
import logging
from django.core.management import setup_environ
import settings
setup_environ(settings)
logging.basicConfig(level=logging.INFO)
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger('runcron')
try:
@@ -19,11 +20,11 @@ for i in sys.argv[1].split(".")[1:]:
mod = getattr(mod, i)
cron_class = getattr(mod, sys.argv[2])()
log.info("Starting Job %s in %s" % (sys.argv[2], sys.argv[1])
log.info("Starting Job %s in %s" % (sys.argv[2], sys.argv[1]))
try:
cron_class.job()
except:
log.error("Error executing job, aborting.")
#try:
cron_class.job()
#except:
# log.error("Error executing job, aborting.")
log.info("Job complete")