<commit_before>class GroupsController < GroupBaseController
  # TODO Jon: some of the code for tagging in this controller can probably
  # be moved into the model

  load_and_authorize_resource except: :show
  before_filter :check_group_read_permissions, :only => :show

  def create
    build_resource
    @group.add_admin! current_user
    create!
  end<commit_msg>groups_controller: bugfixing on create method<commit_after>class GroupsController < GroupBaseController
  # TODO Jon: some of the code for tagging in this controller can probably
  # be moved into the model

  load_and_authorize_resource except: :show
  before_filter :check_group_read_permissions, :only => :show

  def create
    @group = Group.new(params[:group])
    if @group.save
      @group.add_admin! current_user
      flash[:notice] = "Group created successfully."
      redirect_to @group
    else
      redirect_to :back
    end
  end
{'fraction_non_alphanumeric': 0.06236323851203501, 'fraction_numerical': 0.0, 'mean_word_length': 4.083333333333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5813885', 'n_tokens_mistral': 265, 'n_tokens_neox': 256, 'n_words': 85}