<commit_before>class CoreTeamMembersController < ApplicationController

  def create
    authenticate_user!
    find_product!
    authorize! :edit, @product

    user = User.find_by_username(core_team_member_params.fetch(:username))
    if user
      @product.core_team << user
      CoreTeamMailer.delay.welcome(@product.id, user.id)
    end

    redirect_to edit_product_path(@product)
  end

  def find_product!
    @product = Product.find_by_slug(params[:product_id])
  end

  def core_team_member_params
    params.require(:core_team_member).permit(:username)
  end

end<commit_msg>Add core team member to github admins for repos<commit_after>class CoreTeamMembersController < ApplicationController

  def create
    authenticate_user!
    find_product!
    authorize! :edit, @product

    user = User.find_by_username(core_team_member_params.fetch(:username))
    if user
      @product.core_team << user
      CoreTeamMailer.delay.welcome(@product.id, user.id)

      if user.has_github_account?
        Github::AddCollaboratorToProductRepoWorker.perform_async(
          @product.slug,
          user.github_login
        )
      end
    end

    redirect_to edit_product_path(@product)
  end

  def find_product!
    @product = Product.find_by_slug(params[:product_id])
  end

  def core_team_member_params
    params.require(:core_team_member).permit(:username)
  end

end
{'fraction_non_alphanumeric': 0.08031837916063676, 'fraction_numerical': 0.0, 'mean_word_length': 3.752577319587629, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, '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': '2551032', 'n_tokens_mistral': 438, 'n_tokens_neox': 426, 'n_words': 77}