<commit_before>class RegistrationsController < Devise::RegistrationsController
  protected

  def after_sign_up_path_for(resource)
    "/#{I18n.locale}/sign_up_success"
  end
end
<commit_msg>Changed registration redirect if user is backing a campaign<commit_after>class RegistrationsController < Devise::RegistrationsController
  protected

  def after_sign_up_path_for(resource)
    return_to = session[:return_to]
    if return_to and return_to.include?('contributions')
      return_to = session[:return_to]
      session[:return_to] = nil
      return return_to
    else
      return "/#{I18n.locale}/sign_up_success"
    end
  end
end

{'fraction_non_alphanumeric': 0.078125, 'fraction_numerical': 0.00625, 'mean_word_length': 4.723214285714286, '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': '3302448', 'n_tokens_mistral': 200, 'n_tokens_neox': 196, 'n_words': 41}