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

13 lines
399 B
Python
Raw Normal View History

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