mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03:00
🐛 Fixed members list not loading (#12930)
refs https://github.com/TryGhost/Team/issues/660 In case stripe price for a subscription is missing in `stripe_prices` table, it will cause the API to load members list to fail with 500 as we try to serialize the stripe price on member subscription using empty object. This fixes the guard against populating price object for missing data in DB. Note: This is only a short-term fix till we add a proper fix to cleanup the DB in the subsequent release.
This commit is contained in:
parent
bea04e437d
commit
367b1a509f
@ -1,4 +1,5 @@
|
||||
const ghostBookshelf = require('./base');
|
||||
const _ = require('lodash');
|
||||
|
||||
const StripeCustomerSubscription = ghostBookshelf.Model.extend({
|
||||
tableName: 'members_stripe_customers_subscriptions',
|
||||
@ -37,7 +38,7 @@ const StripeCustomerSubscription = ghostBookshelf.Model.extend({
|
||||
current_period_end: defaultSerializedObject.current_period_end
|
||||
};
|
||||
|
||||
if (defaultSerializedObject.stripePrice) {
|
||||
if (!_.isEmpty(defaultSerializedObject.stripePrice)) {
|
||||
serialized.price = {
|
||||
id: defaultSerializedObject.stripePrice.stripe_price_id,
|
||||
price_id: defaultSerializedObject.stripePrice.id,
|
||||
|
Loading…
Reference in New Issue
Block a user