<commit_before>class RegistrantsController < ApplicationController
  before_filter :authenticate_user!
  load_and_authorize_resource :user, only: [:index]
  load_and_authorize_resource except: :new
  load_and_authorize_resource through: :current_user, only: :new
  # NOTE: This isn't working 100%, it fails when a create fails (the breadcrumb is incorrect)

  before_action :set_registrants_breadcrumb
  before_action :set_single_registrant_breadcrumb, only: [:edit, :show, :reg_fee]
  before_action :set_new_registrant_breadcrumb, only: [:new]

  # GET /registrants/manage_all
  def manage_all
    @registrants = Registrant.includes(:user, :contact_detail)
    respond_to do |format|
      format.html { render "manage_all" }
      format.pdf { render :pdf => "manage_all", :template => "registrants/manage_all.html.haml", :formats => [:html], :layout => "pdf.html" }
    end
  end

  # post /registrants/manage_one
  def manage_one
  end

  # post /registrant/choose_one
  def choose_one
    if params[:registrant_id].nil?
      flash[:error] = "Choose a Registrant"
      redirect_to manage_one_registrants_path
    else
      registrant = Registrant.find(params[:registrant_id])
      if params[:summary] == "1"
        redirect_to registrant_path(registrant)
      else
        redirect_to edit_registrant_path(registrant)
      end
    end
  end

  # GET /users/12/registrants
  def index
    @my_registrants = @user.registrants.active
    @shared_registrants = @user.accessible_registrants - @my_registrants
    @total_owing = @user.total_owing
    @display_invitation_request = @user.invitations.need_reply.count > 0
    @display_invitation_manage_banner = @user.invitations.permitted.count > 0
    @has_print_waiver = @config.has_print_waiver<commit_msg>fix manage_one<commit_after>class RegistrantsController < ApplicationController
  before_filter :authenticate_user!
  load_and_authorize_resource :user, only: [:index]
  load_and_authorize_resource except: :new
  load_and_authorize_resource through: :current_user, only: :new
  # NOTE: This isn't working 100%, it fails when a create fails (the breadcrumb is incorrect)

  before_action :set_registrants_breadcrumb
  before_action :set_single_registrant_breadcrumb, only: [:edit, :show, :reg_fee]
  before_action :set_new_registrant_breadcrumb, only: [:new]

  # GET /registrants/manage_all
  def manage_all
    @registrants = Registrant.includes(:user, :contact_detail)
    respond_to do |format|
      format.html { render "manage_all" }
      format.pdf { render :pdf => "manage_all", :template => "registrants/manage_all.html.haml", :formats => [:html], :layout => "pdf.html" }
    end
  end

  # post /registrants/manage_one
  def manage_one
  end

  # post /registrant/choose_one
  def choose_one
    if params[:registrant_id].blank?
      flash[:error] = "Choose a Registrant"
      redirect_to manage_one_registrants_path
    else
      registrant = Registrant.find(params[:registrant_id])
      if params[:summary] == "1"
        redirect_to registrant_path(registrant)
      else
        redirect_to edit_registrant_path(registrant)
      end
    end
  end

  # GET /users/12/registrants
  def index
    @my_registrants = @user.registrants.active
    @shared_registrants = @user.accessible_registrants - @my_registrants
    @total_owing = @user.total_owing
    @display_invitation_request = @user.invitations.need_reply.count > 0
    @display_invitation_manage_banner = @user.invitations.permitted.count > 0
    @has_print_waiver = @config.has_print_waiver
{'fraction_non_alphanumeric': 0.09294417682062907, 'fraction_numerical': 0.004533862283933126, 'mean_word_length': 4.332326283987915, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '514394', 'n_tokens_mistral': 1222, 'n_tokens_neox': 1175, 'n_words': 238}