code: def consume_tickets(self, user):
          
          for ticket in self.filter(user=user, consumed__isnull=True,
                                    expires__gt=now()):
              ticket.consume()
docs: Consume all valid ``Ticket``s for a specified user. This is run
          when the user logs out to ensure all issued tickets are no longer
          valid for future authentication attempts.