mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -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);
|
return proto.onFetchingCollection.call(this, collection, attrs, options);
|
||||||
},
|
},
|
||||||
|
|
||||||
// NOTE: sending `post.author = {}` was always ignored [unsupported]
|
|
||||||
onCreating: function onCreating(model, attrs, options) {
|
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')) {
|
if (!model.get('authors')) {
|
||||||
model.set('authors', [{
|
model.set('authors', [{
|
||||||
id: model.get('author_id')
|
id: this.contextUser(options)
|
||||||
}]);
|
}]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue