<commit_before># frozen_string_literal: true

module Admin
  class AccountActionsController < BaseController
    before_action :set_account

    def new
      @account_action  = Admin::AccountAction.new(type: params[:type], report_id: params[:report_id], send_email_notification: true)
      @warning_presets = AccountWarningPreset.all
    end

    def create
      account_action                 = Admin::AccountAction.new(resource_params)
      account_action.target_account  = @account
      account_action.current_account = current_account

      account_action.save!

      if account_action.with_report?
        redirect_to admin_report_path(account_action.report)
      else
        redirect_to admin_account_path(@account.id)<commit_msg>Redirect to reports overview instead of report after account action (#9639)<commit_after># frozen_string_literal: true

module Admin
  class AccountActionsController < BaseController
    before_action :set_account

    def new
      @account_action  = Admin::AccountAction.new(type: params[:type], report_id: params[:report_id], send_email_notification: true)
      @warning_presets = AccountWarningPreset.all
    end

    def create
      account_action                 = Admin::AccountAction.new(resource_params)
      account_action.target_account  = @account
      account_action.current_account = current_account

      account_action.save!

      if account_action.with_report?
        redirect_to admin_reports_path
      else
        redirect_to admin_account_path(@account.id)
{'fraction_non_alphanumeric': 0.06535947712418301, 'fraction_numerical': 0.00261437908496732, 'mean_word_length': 3.7253086419753085, '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': '7583953', 'n_tokens_mistral': 419, 'n_tokens_neox': 404, 'n_words': 85}