X-Git-Url: https://git.mdrn.pl/django-cas-provider.git/blobdiff_plain/3e3322506beb1dc6f1e4a2b5343c81fbf7e77a17..b88bb747c08269f187d6073504c7dca3568112b9:/cas_provider/management/commands/cleanuptickets.py?ds=sidebyside diff --git a/cas_provider/management/commands/cleanuptickets.py b/cas_provider/management/commands/cleanuptickets.py index 401bec1..6715151 100644 --- a/cas_provider/management/commands/cleanuptickets.py +++ b/cas_provider/management/commands/cleanuptickets.py @@ -6,7 +6,6 @@ Calls ``ServiceTickets.objects.delete_expired_users()``, which contains the actual logic for determining which accounts are deleted. """ - from django.core.management.base import NoArgsCommand from django.conf import settings @@ -18,21 +17,21 @@ class Command(NoArgsCommand): help = "Delete expired service tickets from the database" def handle_noargs(self, **options): - print "Service tickets:" + print("Service tickets:") tickets = ServiceTicket.objects.all() for ticket in tickets: expiration = datetime.timedelta(minutes=settings.CAS_TICKET_EXPIRATION) if datetime.datetime.now() > ticket.created + expiration: - print "Deleting %s..." % ticket.ticket + print("Deleting %s..." % ticket.ticket) ticket.delete() else: - print "%s not expired..." % ticket.ticket + print("%s not expired..." % ticket.ticket) tickets = LoginTicket.objects.all() - print "Login tickets:" + print("Login tickets:") for ticket in tickets: expiration = datetime.timedelta(minutes=settings.CAS_TICKET_EXPIRATION) if datetime.datetime.now() > ticket.created + expiration: - print "Deleting %s..." % ticket.ticket + print("Deleting %s..." % ticket.ticket) ticket.delete() else: - print "%s not expired..." % ticket.ticket \ No newline at end of file + print("%s not expired..." % ticket.ticket)