From e3d15071592c48717da73cca5cceea30917f6290 Mon Sep 17 00:00:00 2001 From: Naz Date: Mon, 4 Apr 2022 10:45:33 +0800 Subject: [PATCH] Removed accessive id erros in tests refs https://github.com/naz/Ghost/commit/7172db74b0f21e1f2761664762d21c0812405fe1#r70370252 - The changes referenced above changed fixtures without taking "test fixtures" in "test/utils/fixtures/fixtures.json" into account. This fix is only cosmetical to unlutter the test output with logging level set to "error". Once the referenced comment is answered a proper fix should be applied here --- core/server/services/auth/setup.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/server/services/auth/setup.js b/core/server/services/auth/setup.js index f78020c994..e563419825 100644 --- a/core/server/services/auth/setup.js +++ b/core/server/services/auth/setup.js @@ -142,7 +142,10 @@ async function doFixtures(data) { mobiledoc = mobiledoc.replace(/{{date}}/, date); const post = await models.Post.findOne({slug: key}); - await models.Post.edit({mobiledoc}, {id: post.id}); + + if (post) { + await models.Post.edit({mobiledoc}, {id: post.id}); + } }); return data;