Fix standard urls. Test for Django up to 5.0.
[django-cas-provider.git] / cas_provider / management / commands / cleanuptickets.py
index 772fdcb..6715151 100644 (file)
@@ -6,9 +6,7 @@ Calls ``ServiceTickets.objects.delete_expired_users()``, which
 contains the actual logic for determining which accounts are deleted.
 
 """
 contains the actual logic for determining which accounts are deleted.
 
 """
-
 from django.core.management.base import NoArgsCommand
 from django.core.management.base import NoArgsCommand
-from django.core.management.base import CommandError
 from django.conf import settings
 
 import datetime
 from django.conf import settings
 
 import datetime
@@ -19,21 +17,21 @@ class Command(NoArgsCommand):
     help = "Delete expired service tickets from the database"
 
     def handle_noargs(self, **options):
     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:
         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:
                 ticket.delete()
             else:
-                print "%s not expired..." % ticket.ticket
+                print("%s not expired..." % ticket.ticket)
         tickets = LoginTicket.objects.all()
         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:
         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:
                 ticket.delete()
             else:
-                print "%s not expired..." % ticket.ticket
\ No newline at end of file
+                print("%s not expired..." % ticket.ticket)