diff --git a/server/models/Document.ts b/server/models/Document.ts index 3576bcffc..df664d7f9 100644 --- a/server/models/Document.ts +++ b/server/models/Document.ts @@ -761,7 +761,7 @@ class Document extends ParanoidModel { } } - if (!this.template && collection) { + if (!this.template && this.publishedAt && collection) { await collection.addDocumentToStructure(this, undefined, { transaction, });