<commit_before>class DeviseExtensions::RegistrationsController < Devise::RegistrationsController
  # GET /resource/sign_up
  def new
    resource = build_resource({})
    
    @presenter = Resources::User::FormPresenter.new(self.view_context, resource: resource)  
    
    respond_with resource
  end
  
  # POST /resource
  def create
    build_resource

    captcha_verified = if Rails.env == 'production'
      verify_recaptcha(model: resource, message: I18n.t('general.exceptions.wrong_recaptcha'))
    else
      true
    end
    
    if captcha_verified && resource.save
      if resource.active_for_authentication?
        set_flash_message :notice, :signed_up if is_navigational_format?
        sign_in(resource_name, resource)
        respond_with resource, :location => after_sign_up_path_for(resource)
      else
        set_flash_message :notice, :"signed_up_but_#{resource.inactive_message}" if is_navigational_format?
        expire_session_data_after_sign_in!
        respond_with resource, :location => after_inactive_sign_up_path_for(resource)
      end
    else
      clean_up_passwords resource<commit_msg>Set presenter if registration fails<commit_after>class DeviseExtensions::RegistrationsController < Devise::RegistrationsController
  # GET /resource/sign_up
  def new
    resource = build_resource({})
    
    @presenter = Resources::User::FormPresenter.new(self.view_context, resource: resource)  
    
    respond_with resource
  end
  
  # POST /resource
  def create
    build_resource

    captcha_verified = if Rails.env == 'production'
      verify_recaptcha(model: resource, message: I18n.t('general.exceptions.wrong_recaptcha'))
    else
      true
    end
    
    if captcha_verified && resource.save
      if resource.active_for_authentication?
        set_flash_message :notice, :signed_up if is_navigational_format?
        sign_in(resource_name, resource)
        respond_with resource, :location => after_sign_up_path_for(resource)
      else
        set_flash_message :notice, :"signed_up_but_#{resource.inactive_message}" if is_navigational_format?
        expire_session_data_after_sign_in!
        respond_with resource, :location => after_inactive_sign_up_path_for(resource)
      end
    else
      @presenter = Resources::User::FormPresenter.new(self.view_context, resource: resource)  
      clean_up_passwords resource
{'fraction_non_alphanumeric': 0.0751371886872098, 'fraction_numerical': 0.0016884761502743773, 'mean_word_length': 3.836734693877551, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '5147073', 'n_tokens_mistral': 717, 'n_tokens_neox': 708, 'n_words': 133}