def dt_logout(request, next_page=None):
 username = request.user.get_username()
 request.audit = {'username': username, 'operation': 'USER_LOGOUT', 'operationText': ('Logged out user: %s' % username)}
 backends = get_backends()
 if backends:
  for backend in backends:
   if hasattr(backend, 'logout'):
    try:
     response = backend.logout(request, next_page)
     if response:
      return response
    except Exception as e:
     LOG.warn(('Potential error on logout for user: %s with exception: %s' % (username, e)))
 if (len(filter((lambda backend: hasattr(backend, 'logout')), backends)) == len(backends)):
  LOG.warn(('Failed to log out from all backends for user: %s' % username))
 return django.contrib.auth.views.logout(request, next_page)

def dt_logout ( request , next_page = None ) : username = request . user . get_username ( ) request . audit = { 'username' : username , 'operation' : 'USER_LOGOUT' , 'operationText' : ( 'Logged out user: %s' % username ) } backends = get_backends ( ) if backends : for backend in backends : if hasattr ( backend , 'logout' ) : try : response = backend . logout ( request , next_page ) if response : return response except Exception as e : LOG . warn ( ( 'Potential error on logout for user: %s with exception: %s' % ( username , e ) ) ) if ( len ( filter ( ( lambda backend : hasattr ( backend , 'logout' ) ) , backends ) ) == len ( backends ) ) : LOG . warn ( ( 'Failed to log out from all backends for user: %s' % username ) ) return django . contrib . auth . views . logout ( request , next_page )
log out the user .