mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Removed creation of single author on post creation
refs https://github.com/TryGhost/Toolbox/issues/230
This commit is contained in:
parent
efc443a8d1
commit
e8f20e5f12
1 changed files with 1 additions and 10 deletions
|
@ -85,19 +85,10 @@ module.exports.extendModel = function extendModel(Post, Posts, ghostBookshelf) {
|
|||
return proto.onFetchingCollection.call(this, collection, attrs, options);
|
||||
},
|
||||
|
||||
// NOTE: sending `post.author = {}` was always ignored [unsupported]
|
||||
onCreating: function onCreating(model, attrs, options) {
|
||||
if (!model.get('author_id')) {
|
||||
if (model.get('authors')) {
|
||||
model.set('author_id', model.get('authors')[0].id);
|
||||
} else {
|
||||
model.set('author_id', this.contextUser(options));
|
||||
}
|
||||
}
|
||||
|
||||
if (!model.get('authors')) {
|
||||
model.set('authors', [{
|
||||
id: model.get('author_id')
|
||||
id: this.contextUser(options)
|
||||
}]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue