<commit_before>class InstitutionsController < ApplicationController

  before_action :require_login, :except=>[:partners_list]
  before_action :set_institution, only: [:show, :destroy]
  before_action :check_for_cancel, :update => [:create, :update, :destroy]
  before_filter :populate_institution_select_list, only: [:index]
  before_action :check_institution_admin_access, :except=>[:partners_list]

  # GET /institutions
  # GET /institutions.json
  def index

    if user_role_in?(:dmp_admin)
      @institutions = Institution.all
    else
      @institutions = Institution.where(id: [current_user.institution.subtree_ids])
    end

    @institution = Institution.new(:parent_id => params[:parent_id])

    @current_institution = current_user.institution

    @institution_users = institutional_admins

    @categories.delete_if {|i| i[1] == current_user.institution.id}

    manage_users

    institutional_resources
<commit_msg>fix bug when creating new institution<commit_after>class InstitutionsController < ApplicationController

  before_action :require_login, :except=>[:partners_list]
  before_action :set_institution, only: [:show, :destroy]
  before_action :check_for_cancel, :update => [:create, :update, :destroy]
  before_filter :populate_institution_select_list, only: [:index, :new]
  before_action :check_institution_admin_access, :except=>[:partners_list]

  # GET /institutions
  # GET /institutions.json
  def index

    if user_role_in?(:dmp_admin)
      @institutions = Institution.all
    else
      @institutions = Institution.where(id: [current_user.institution.subtree_ids])
    end

    @institution = Institution.new(:parent_id => params[:parent_id])

    @current_institution = current_user.institution

    @institution_users = institutional_admins

    @categories.delete_if {|i| i[1] == current_user.institution.id}

    manage_users

    institutional_resources

{'fraction_non_alphanumeric': 0.10221285563751317, 'fraction_numerical': 0.001053740779768177, 'mean_word_length': 5.267326732673268, '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': '1548943', 'n_tokens_mistral': 609, 'n_tokens_neox': 584, 'n_words': 110}