mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 03:14:03 +03:00
Moved email verification logic into separate method
refs https://github.com/TryGhost/Team/issues/912 - The processImport method was becoming to big and unreadable - Having small methods is easier to extract if needed later
This commit is contained in:
parent
93e8814589
commit
fa33235fd9
@ -67,14 +67,10 @@ const membersImporter = new MembersCSVImporter({
|
||||
importThreshold: getThreshold()
|
||||
});
|
||||
|
||||
const processImport = async (options) => {
|
||||
const result = await membersImporter.process(options);
|
||||
const freezeTriggered = result.meta.freeze;
|
||||
delete result.meta.freeze;
|
||||
|
||||
const startEmailVerification = async () => {
|
||||
const isVerifiedEmail = config.get('hostSettings:emailVerification:verified') === true;
|
||||
|
||||
if ((!isVerifiedEmail) && freezeTriggered) {
|
||||
if ((!isVerifiedEmail)) {
|
||||
await models.Settings.edit([{
|
||||
key: 'email_freeze',
|
||||
value: true
|
||||
@ -84,6 +80,16 @@ const processImport = async (options) => {
|
||||
message: tpl(messages.emailVerificationNeeded)
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const processImport = async (options) => {
|
||||
const result = await membersImporter.process(options);
|
||||
const freezeTriggered = result.meta.freeze;
|
||||
delete result.meta.freeze;
|
||||
|
||||
if (freezeTriggered) {
|
||||
await startEmailVerification();
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user