<commit_before>class ProfilesController < ApplicationController
  #resources_controller_for :profiles, :class => User #, :only => [:show]
  #before_filter :redirect_appropriately, :except => [:show]
  before_filter :get_profile, :except => :ban
  
  def ban
    user = User.find(params[:id])
    user.update_attribute(:is_banned, true) if current_user && current_user.is_a?(Admin) && user
    redirect_to :back
    return
  end
  
  def unban
    user = User.find(params[:id])
    user.update_attributes(:is_banned, false) if current_user && current_user.is_a?(Admin) && user
    redirect_to :back
    return
  end
  
  private

  def redirect_appropriately
    redirect_to(logged_in? ? myspot_profile_path : root_path)
  end
  
  def get_profile<commit_msg>adding unban to the except statement<commit_after>class ProfilesController < ApplicationController
  #resources_controller_for :profiles, :class => User #, :only => [:show]
  #before_filter :redirect_appropriately, :except => [:show]
  before_filter :get_profile, :except => [:ban, :unban]
  
  def ban
    user = User.find(params[:id])
    user.update_attribute(:is_banned, true) if current_user && current_user.is_a?(Admin) && user
    redirect_to :back
    return
  end
  
  def unban
    user = User.find(params[:id])
    user.update_attributes(:is_banned, false) if current_user && current_user.is_a?(Admin) && user
    redirect_to :back
    return
  end
  
  private

  def redirect_appropriately
    redirect_to(logged_in? ? myspot_profile_path : root_path)
  end
  
  def get_profile
{'fraction_non_alphanumeric': 0.10587475790832795, 'fraction_numerical': 0.0, 'mean_word_length': 4.254237288135593, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1771804', 'n_tokens_mistral': 509, 'n_tokens_neox': 510, 'n_words': 113}