From 77a92e8878e550a3c9bb3e435f827c8941d7f8a3 Mon Sep 17 00:00:00 2001 From: Yaw Anokwa Date: Thu, 4 Jan 2018 03:17:35 -0500 Subject: [PATCH] Allow user staging via setting (#5468) --- script/import_scripts/mbox/importer.rb | 2 +- script/import_scripts/mbox/settings.yml | 1 + script/import_scripts/mbox/support/settings.rb | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/script/import_scripts/mbox/importer.rb b/script/import_scripts/mbox/importer.rb index dbdd7c1651d..d894b24f9eb 100644 --- a/script/import_scripts/mbox/importer.rb +++ b/script/import_scripts/mbox/importer.rb @@ -64,7 +64,7 @@ module ImportScripts::Mbox email: row['email'], name: row['name'], trust_level: @settings.trust_level, - staged: true, + staged: @settings.staged, active: false, created_at: to_time(row['date_of_first_message']) } diff --git a/script/import_scripts/mbox/settings.yml b/script/import_scripts/mbox/settings.yml index a8db4453fd7..942ee708d4e 100644 --- a/script/import_scripts/mbox/settings.yml +++ b/script/import_scripts/mbox/settings.yml @@ -8,3 +8,4 @@ split_regex: "" default_trust_level: 1 prefer_html: false +staged: true diff --git a/script/import_scripts/mbox/support/settings.rb b/script/import_scripts/mbox/support/settings.rb index 8ec5456a230..a1fc74d3d1e 100644 --- a/script/import_scripts/mbox/support/settings.rb +++ b/script/import_scripts/mbox/support/settings.rb @@ -12,6 +12,7 @@ module ImportScripts::Mbox attr_reader :batch_size attr_reader :trust_level attr_reader :prefer_html + attr_reader :staged def initialize(yaml) @data_dir = yaml['data_dir'] @@ -19,6 +20,7 @@ module ImportScripts::Mbox @batch_size = 1000 # no need to make this actually configurable at the moment @trust_level = yaml['default_trust_level'] @prefer_html = yaml['prefer_html'] + @staged = yaml['staged'] end end end