<commit_before># -*- encoding : utf-8 -*-
class ContestsController < ApplicationController

  layout :desired_layout

  def signup
    @contests = Contest.current.open
  end

  def performances
    @contest = Contest.find(params[:id])
    @venue = Venue.find(params[:venue_id])
    @date = Date.parse(params[:date]) rescue nil

    if !@contest.timetables_public || !@contest.days.include?(@date)
      render 'pages/not_found'
    else
      @performances = @contest.staged_performances(@venue, @date)
        .includes({ contest_category: :category }, :predecessor, { appearances: :participant })
    end
  end

  private

    def desired_layout
       (params[:bare] == "yes") ? "bare_timetable" : "application"
    end
end<commit_msg>Show 404 when accessing public timetable URL without venue ID<commit_after># -*- encoding : utf-8 -*-
class ContestsController < ApplicationController

  layout :desired_layout

  def signup
    @contests = Contest.current.open
  end

  def performances
    @contest = Contest.find(params[:id])
    @venue = Venue.find(params[:venue_id]) rescue nil
    @date = Date.parse(params[:date]) rescue nil

    if !@contest.timetables_public || !@contest.days.include?(@date) || !@venue
      render 'pages/not_found'
    else
      @performances = @contest.staged_performances(@venue, @date)
        .includes({ contest_category: :category }, :predecessor, { appearances: :participant })
    end
  end

  private

    def desired_layout
       (params[:bare] == "yes") ? "bare_timetable" : "application"
    end
end
{'fraction_non_alphanumeric': 0.12677878395860284, 'fraction_numerical': 0.003234152652005175, 'mean_word_length': 3.6041666666666665, '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': '5548548', 'n_tokens_mistral': 498, 'n_tokens_neox': 468, 'n_words': 109}