From 94f5ad60c38da6d7b9d55ea1b599255b4b7413a2 Mon Sep 17 00:00:00 2001 From: Simon Backx Date: Wed, 22 Feb 2023 19:13:52 +0100 Subject: [PATCH] Added temporary fix for email suppression list error logs in tests refs https://github.com/TryGhost/Team/issues/2598 In tests the model is undefined because the service is imported too early. --- .../email-suppression-list/MailgunEmailSuppressionList.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ghost/core/core/server/services/email-suppression-list/MailgunEmailSuppressionList.js b/ghost/core/core/server/services/email-suppression-list/MailgunEmailSuppressionList.js index 302301a34a..802763b004 100644 --- a/ghost/core/core/server/services/email-suppression-list/MailgunEmailSuppressionList.js +++ b/ghost/core/core/server/services/email-suppression-list/MailgunEmailSuppressionList.js @@ -2,6 +2,7 @@ const {AbstractEmailSuppressionList, EmailSuppressionData, EmailSuppressedEvent} const {SpamComplaintEvent, EmailBouncedEvent} = require('@tryghost/email-events'); const DomainEvents = require('@tryghost/domain-events'); const logging = require('@tryghost/logging'); +const models = require('../../models'); /** * @typedef {object} IMailgunAPIClient @@ -95,6 +96,7 @@ class MailgunEmailSuppressionList extends AbstractEmailSuppressionList { } async init() { + this.Suppression = models.Suppression; const handleEvent = reason => async (event) => { try { if (reason === 'bounce') {