Files
test-auth/sso/cron.py
Andrew Williams 07450ca5dd 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.
2010-03-24 14:52:08 +00:00

27 lines
720 B
Python

import logging
from django.contrib.auth.models import User, Group
from eve_api.models import EVEAccount
from sso.models import ServiceAccount
class RemoveInvalidUsers():
"""
Cycles through all users, check if their permissions are correct.
"""
# run every 2 hours
run_every = 7200
@property
def _logger(self):
if not hasattr(self, '__logger'):
self.__logger = logging.getLogger(__name__)
return self.__logger
def job(self):
for user in User.objects.all():
# For each user, update access list based on Corp details
user.get_profile().update_access()