Commit 37c9526b authored by Audrey Hamelers's avatar Audrey Hamelers
parent 7c7959fd
Pipeline #13006 passed with stages
in 6 minutes and 5 seconds
......@@ -157,7 +157,11 @@ async function alertNeedFix() {
m.teams.find(t => t.roleName === 'reviewer') &&
m.teams.find(t => t.roleName === 'reviewer').users[0]
const users = submitter ? [submitter] : []
if (!m.teams.some(t => t.userId === m.updatedBy) && reviewer) {
if (
!m.teams.some(t => t.userId === m.updatedBy) &&
reviewer &&
reviewer.id !== submitter.id
) {
users.push(reviewer)
}
if (users.length > 0) {
......@@ -166,7 +170,9 @@ async function alertNeedFix() {
title: m['meta,title'],
}
logger.info(`Sending email for stalled error manuscript ${m.id}`)
await Promise.all(users.map(u => stalledErrorEmail(manInfo, u)))
await Promise.all(
users.map(async u => stalledErrorEmail(manInfo, u)),
)
} else {
throw new Error('No users to email')
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment