<commit_before>class SubmissionsController < ApplicationController
  skip_before_filter :authenticate_user!, if: :should_skip_janky_auth?
  skip_before_action :verify_authenticity_token, only: [:create]

  def create    
    @submission = Submission.new(
      raw_content:      params.to_json, 
      ip_addr:          params['IP'], 
      entry_id:         params['EntryID'],
      form_structure:   params["FormStructure"],
      field_structure:  params["FieldStructure"]
    )

    # Parse the email, and add the associated person
    email_address = @submission.form_email || nil
    person = Person.find_by_email_address(email_address) 
    
    if @submission.save
      Rails.logger.info("SubmissionsController#create: recorded a new submission for #{email_address}")<commit_msg>Needed to save person to submission instance.<commit_after>class SubmissionsController < ApplicationController
  skip_before_filter :authenticate_user!, if: :should_skip_janky_auth?
  skip_before_action :verify_authenticity_token, only: [:create]

  def create    
    @submission = Submission.new(
      raw_content:      params.to_json, 
      ip_addr:          params['IP'], 
      entry_id:         params['EntryID'],
      form_structure:   params["FormStructure"],
      field_structure:  params["FieldStructure"]
    )

    # Parse the email, and add the associated person
    email_address = @submission.form_email || nil
    @submission.person = Person.find_by_email_address(email_address) 
    
    if @submission.save
      Rails.logger.info("SubmissionsController#create: recorded a new submission for #{email_address}")
{'fraction_non_alphanumeric': 0.08950617283950617, 'fraction_numerical': 0.0, 'mean_word_length': 3.781710914454277, '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': '5383170', 'n_tokens_mistral': 474, 'n_tokens_neox': 455, 'n_words': 99}