Only SSO upon validated tickets

This commit is contained in:
Valentin Samir 2015-05-23 21:12:42 +02:00
parent 0a3e95ba2b
commit cf49573c61

View File

@ -41,13 +41,13 @@ class User(models.Model):
def logout(self, request): def logout(self, request):
async_list = [] async_list = []
session = FuturesSession(executor=ThreadPoolExecutor(max_workers=10)) session = FuturesSession(executor=ThreadPoolExecutor(max_workers=10))
for ticket in ServiceTicket.objects.filter(user=self): for ticket in ServiceTicket.objects.filter(user=self, validate=True):
async_list.append(ticket.logout(request, session)) async_list.append(ticket.logout(request, session))
ticket.delete() ticket.delete()
for ticket in ProxyTicket.objects.filter(user=self): for ticket in ProxyTicket.objects.filter(user=self, validate=True):
async_list.append(ticket.logout(request, session)) async_list.append(ticket.logout(request, session))
ticket.delete() ticket.delete()
for ticket in ProxyGrantingTicket.objects.filter(user=self): for ticket in ProxyGrantingTicket.objects.filter(user=self, validate=True):
async_list.append(ticket.logout(request, session)) async_list.append(ticket.logout(request, session))
ticket.delete() ticket.delete()
for future in async_list: for future in async_list: