<commit_before>class HomeController < PublicController

  def index
    @has_news = false
    if environment.enabled?('use_portal_community') && environment.portal_community
      @has_news = true
      @news_cache_key = environment.portal_news_cache_key(FastGettext.locale)
      if !read_fragment(@news_cache_key)
        portal_community = environment.portal_community
        @highlighted_news = portal_community.news(2, true)
        @portal_news = portal_community.news(7, true) - @highlighted_news
        @area_news = environment.portal_folders
      end
    end
  end

  def terms
    @no_design_blocks = true
  end

  def welcome
    self.class.no_design_blocks
    @display_confirmation_tips = !user.present? && !environment.enabled?(:skip_new_user_email_confirmation)
    @person_template = Person.find(params[:template_id])
    @template_welcome_page = @person_template.welcome_page && @person_template.welcome_page.published ? @person_template.welcome_page.body : nil
  end

end<commit_msg>[template-welcome-page] Avoid crash on welcome page when there is no template<commit_after>class HomeController < PublicController

  def index
    @has_news = false
    if environment.enabled?('use_portal_community') && environment.portal_community
      @has_news = true
      @news_cache_key = environment.portal_news_cache_key(FastGettext.locale)
      if !read_fragment(@news_cache_key)
        portal_community = environment.portal_community
        @highlighted_news = portal_community.news(2, true)
        @portal_news = portal_community.news(7, true) - @highlighted_news
        @area_news = environment.portal_folders
      end
    end
  end

  def terms
    @no_design_blocks = true
  end

  def welcome
    self.class.no_design_blocks
    @display_confirmation_tips = !user.present? && !environment.enabled?(:skip_new_user_email_confirmation)
    @person_template = user && user.template || params[:template_id] && Person.find(params[:template_id])
    @template_welcome_page = @person_template && @person_template.welcome_page && @person_template.welcome_page.published ? @person_template.welcome_page.body : nil
  end

end
{'fraction_non_alphanumeric': 0.08734236338159738, 'fraction_numerical': 0.0018682858477347033, 'mean_word_length': 4.3283582089552235, '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': '3857382', 'n_tokens_mistral': 660, 'n_tokens_neox': 650, 'n_words': 113}