def get_current_users():
 current_users = {}
 for session in Session.objects.all():
  try:
   uid = session.get_decoded().get(django.contrib.auth.SESSION_KEY)
  except SuspiciousOperation:
   uid = None
  if (uid is not None):
   try:
    userobj = User.objects.get(pk=uid)
    current_users[userobj] = last_access_map.get(userobj.username, {})
   except User.DoesNotExist:
    LOG.debug(('User with id=%d does not exist' % uid))
 return current_users

def get_current_users ( ) : current_users = { } for session in Session . objects . all ( ) : try : uid = session . get_decoded ( ) . get ( django . contrib . auth . SESSION_KEY ) except SuspiciousOperation : uid = None if ( uid is not None ) : try : userobj = User . objects . get ( pk = uid ) current_users [ userobj ] = last_access_map . get ( userobj . username , { } ) except User . DoesNotExist : LOG . debug ( ( 'User with id=%d does not exist' % uid ) ) return current_users
return dictionary of user objects and a dictionary of the users ip address and last access time .