From 3eb8b91a6b4a0a63eeeacb946427cb2837791fc3 Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Thu, 25 Feb 2021 14:23:36 +0000 Subject: [PATCH] Fixed `paid` flag on members refs https://github.com/TryGhost/Ghost/issues/12602 As part of the member events, we added a third status of 'comped'. Members with a status of 'comped' should still be considered paid, so this fixes the definition of the paid flag to take that into account. --- core/frontend/services/themes/middleware.js | 2 +- core/server/services/members/utils.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/frontend/services/themes/middleware.js b/core/frontend/services/themes/middleware.js index 60740089d0..baa5166a61 100644 --- a/core/frontend/services/themes/middleware.js +++ b/core/frontend/services/themes/middleware.js @@ -169,7 +169,7 @@ function updateLocalTemplateOptions(req, res, next) { default_payment_card_last4: sub.default_payment_card_last4 || '****' }); }), - paid: req.member.status === 'paid' + paid: req.member.status !== 'free' } : null; hbs.updateLocalTemplateOptions(res.locals, _.merge({}, localTemplateOptions, { diff --git a/core/server/services/members/utils.js b/core/server/services/members/utils.js index bc9285c99e..3b4c057826 100644 --- a/core/server/services/members/utils.js +++ b/core/server/services/members/utils.js @@ -10,6 +10,6 @@ module.exports.formattedMemberResponse = function formattedMemberResponse(member avatar_image: member.avatar_image, subscribed: !!member.subscribed, subscriptions: member.subscriptions || [], - paid: member.status === 'paid' + paid: member.status !== 'free' }; };