<commit_before>class SolutionFinder
  def initialize(challenge, user)
    @challenge = challenge
    @user = user
  end

  def find_solution
    # 1. if myself only, as usual
    unless @challenge.team_challenge
      return PeerReview::Solution.find_or_initialize_by(challenge: @challenge, author: @user)
    end

    # 2. if teams, lookup for team's solution
    if @challenge.team_challenge
      return nil unless @user.current_membership.team
      challenge = PeerReview::Solution.find_by(challenge: @challenge, author: @user.current_membership.team.members)
    end
    # 3. if none, create new
    challenge ||= PeerReview::Solution.new(challenge: @challenge, author: @user)
    challenge
  end
end<commit_msg>Hotfix: Show Team Challenge for users without Team<commit_after>class SolutionFinder
  def initialize(challenge, user)
    @challenge = challenge
    @user = user
  end

  def find_solution
    # 1. if myself only, as usual
    unless @challenge.team_challenge
      return PeerReview::Solution.find_or_initialize_by(challenge: @challenge, author: @user)
    end

    # 2. if teams, lookup for team's solution
    if @challenge.team_challenge
      return OpenStruct.new(new_record?: true) unless @user.current_membership.team
      challenge = PeerReview::Solution.find_by(challenge: @challenge, author: @user.current_membership.team.members)
    end
    # 3. if none, create new
    challenge ||= PeerReview::Solution.new(challenge: @challenge, author: @user)
    challenge
  end
end
{'fraction_non_alphanumeric': 0.08915502328675981, 'fraction_numerical': 0.003992015968063872, 'mean_word_length': 3.883116883116883, 'pattern_counts': {'":': 0, '<': 3, '<?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': '947626', 'n_tokens_mistral': 496, 'n_tokens_neox': 423, 'n_words': 123}