django-cas-server/cas_server/management/commands/cas_clean_tickets.py

15 lines
438 B
Python
Raw Normal View History

2015-06-12 16:10:52 +00:00
from django.core.management.base import BaseCommand
2015-05-28 15:30:27 +00:00
from django.utils.translation import ugettext_lazy as _
from ... import models
2015-06-12 16:10:52 +00:00
2015-05-28 15:30:27 +00:00
class Command(BaseCommand):
args = ''
help = _(u"Clean old trickets")
def handle(self, *args, **options):
2015-06-09 20:04:05 +00:00
models.User.clean_old_entries()
2015-05-28 15:30:27 +00:00
for ticket_class in [models.ServiceTicket, models.ProxyTicket, models.ProxyGrantingTicket]:
2015-06-09 20:04:05 +00:00
ticket_class.clean_old_entries()