<commit_before>class RepositoriesController < ApplicationController

  def create
    Github.new(
      user: current_user.username,
      oauth_token: current_user.github_token
    ).repos.create(name: "codelab-#{params[:key]}")
    redirect_to request.referer + '#project'
  end

end<commit_msg>fix for rare double-requests to create a repo<commit_after>class RepositoriesController < ApplicationController

  def create
    Github.new(
      user: current_user.username,
      oauth_token: current_user.github_token
    ).repos.create(name: "codelab-#{params[:key]}")
    redirect_to request.referer + '#project'
  # Will occur in rare cases where a repo creation
  # is triggered twice in a row.
  rescue Github::Error::UnprocessableEntity
    redirect_to request.referer + '#project'
  end

end
{'fraction_non_alphanumeric': 0.09386733416770963, 'fraction_numerical': 0.0, 'mean_word_length': 4.194805194805195, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7237640', 'n_tokens_mistral': 241, 'n_tokens_neox': 242, 'n_words': 60}