Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Jul 22, 2020
1 parent 67ca5e3 commit 72c60d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/user/digest.js
Expand Up @@ -123,14 +123,14 @@ Digest.send = async function (data) {

// Fix relative paths in topic data
topicsData = topicsData.map(function (topicObj) {
const user = topicObj.hasOwnProperty('teaser') && topicObj.teaser !== undefined ? topicObj.teaser.user : topicObj.user;
const user = topicObj.hasOwnProperty('teaser') && topicObj.teaser && topicObj.teaser.user ? topicObj.teaser.user : topicObj.user;
if (user && user.picture && utils.isRelativeUrl(user.picture)) {
user.picture = nconf.get('base_url') + user.picture;
}
return topicObj;
});
emailsSent += 1;
const now = Date.now();
const now = new Date();
try {
await emailer.send('digest', userObj.uid, {
subject: '[[email:digest.subject, ' + (now.getFullYear() + '/' + (now.getMonth() + 1) + '/' + now.getDate()) + ']]',
Expand All @@ -142,7 +142,7 @@ Digest.send = async function (data) {
showUnsubscribe: true,
});
} catch (err) {
winston.error('[user/jobs] Could not send digest email', err.stack);
winston.error('[user/jobs] Could not send digest email\n' + err.stack);
}

if (data.interval !== 'alltime') {
Expand Down

0 comments on commit 72c60d1

Please sign in to comment.