Skip to content

A platform for community discussion. Free, open, simple.

Allow user staging via setting (#5468)

Yaw Anokwa77a92e8878e5
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