@intercept_errors(UserAPIInternalError, ignore_errors=[UserAPIRequestError])
def get_account_settings(request, usernames=None, configuration=None, view=None):
 requesting_user = request.user
 usernames = (usernames or [requesting_user.username])
 requested_users = User.objects.select_related('profile').filter(username__in=usernames)
 if (not requested_users):
  raise UserNotFound()
 serialized_users = []
 for user in requested_users:
  has_full_access = (requesting_user.is_staff or (requesting_user.username == user.username))
  if (has_full_access and (view != 'shared')):
   admin_fields = settings.ACCOUNT_VISIBILITY_CONFIGURATION.get('admin_fields')
  else:
   admin_fields = None
  serialized_users.append(UserReadOnlySerializer(user, configuration=configuration, custom_fields=admin_fields, context={'request': request}).data)
 return serialized_users

@ intercept_errors ( UserAPIInternalError , ignore_errors = [ UserAPIRequestError ] ) def get_account_settings ( request , usernames = None , configuration = None , view = None ) : requesting_user = request . user usernames = ( usernames or [ requesting_user . username ] ) requested_users = User . objects . select_related ( 'profile' ) . filter ( username__in = usernames ) if ( not requested_users ) : raise UserNotFound ( ) serialized_users = [ ] for user in requested_users : has_full_access = ( requesting_user . is_staff or ( requesting_user . username == user . username ) ) if ( has_full_access and ( view != 'shared' ) ) : admin_fields = settings . ACCOUNT_VISIBILITY_CONFIGURATION . get ( 'admin_fields' ) else : admin_fields = None serialized_users . append ( UserReadOnlySerializer ( user , configuration = configuration , custom_fields = admin_fields , context = { 'request' : request } ) . data ) return serialized_users
returns account information for a user serialized as json .