Basic import seems to work
This commit is contained in:
parent
16519c5353
commit
d74806dde3
21 changed files with 555 additions and 749 deletions
|
|
@ -22,10 +22,10 @@ function spawn(callback) {
|
|||
await tx('imports').where('status', ImportStatus.PREP_STOPPING).update({status: ImportStatus.PREP_FAILED});
|
||||
|
||||
await tx('imports').where('status', ImportStatus.RUN_RUNNING).update({status: ImportStatus.RUN_SCHEDULED});
|
||||
await tx('imports').where('status', ImportStatus.RUN_STOPPING).update({status: ImportStatus.RUN_FINISHED});
|
||||
await tx('imports').where('status', ImportStatus.RUN_STOPPING).update({status: ImportStatus.RUN_FAILED});
|
||||
|
||||
await tx('import_runs').where('status', RunStatus.RUNNING).update({status: RunStatus.SCHEDULED});
|
||||
await tx('import_runs').where('status', RunStatus.STOPPING).update({status: RunStatus.FINISHED});
|
||||
await tx('import_runs').where('status', RunStatus.STOPPING).update({status: RunStatus.FAILED});
|
||||
|
||||
}).then(() => {
|
||||
importerProcess = fork(path.join(__dirname, '..', 'services', 'importer.js'), [], {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ const {getTrustedUrl} = require('./urls');
|
|||
const _ = require('./translate')._;
|
||||
const util = require('util');
|
||||
const contextHelpers = require('./context-helpers');
|
||||
const {getFieldKey} = require('../shared/lists');
|
||||
const {getFieldColumn} = require('../shared/lists');
|
||||
const forms = require('../models/forms');
|
||||
const mailers = require('./mailers');
|
||||
|
||||
|
|
@ -101,7 +101,7 @@ async function _sendMail(list, email, template, subject, relativeUrls, subscript
|
|||
const encryptionKeys = [];
|
||||
for (const fld of flds) {
|
||||
if (fld.type === 'gpg' && fld.value) {
|
||||
encryptionKeys.push(subscription[getFieldKey(fld)].value.trim());
|
||||
encryptionKeys.push(subscription[getFieldColumn(fld)].value.trim());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
10
lib/tools.js
10
lib/tools.js
|
|
@ -16,7 +16,6 @@ const fsReadFile = bluebird.promisify(require('fs').readFile);
|
|||
const jsdomEnv = bluebird.promisify(require('jsdom').env);
|
||||
|
||||
|
||||
|
||||
const templates = new Map();
|
||||
|
||||
async function getTemplate(template) {
|
||||
|
|
@ -74,14 +73,7 @@ async function mergeTemplateIntoLayout(template, layout) {
|
|||
return source;
|
||||
}
|
||||
|
||||
|
||||
async function validateEmail(address, checkBlocked) {
|
||||
let user = (address || '').toString().split('@').shift().toLowerCase().replace(/[^a-z0-9]/g, '');
|
||||
|
||||
if (checkBlocked && blockedUsers.indexOf(user) >= 0) {
|
||||
throw new new Error(util.format(_('Blocked email address "%s"'), address));
|
||||
}
|
||||
|
||||
async function validateEmail(address) {
|
||||
const result = await new Promise(resolve => {
|
||||
const result = isemail.validate(address, {
|
||||
checkDNS: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue