mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Only import can override published_by
no issue - published_by should be set to the current user, unless we are in import mode Credits: Matteo Beccaro
This commit is contained in:
parent
a9389bf682
commit
0e80d77100
1 changed files with 3 additions and 2 deletions
|
@ -132,8 +132,9 @@ Post = ghostBookshelf.Model.extend({
|
|||
if (!this.get('published_at')) {
|
||||
this.set('published_at', new Date());
|
||||
}
|
||||
// This will need to go elsewhere in the API layer.
|
||||
if (!this.get('published_by')) {
|
||||
|
||||
// unless published_by is set and we're importing, set published_by to contextUser
|
||||
if (!(this.get('published_by') && options.importing)) {
|
||||
this.set('published_by', this.contextUser(options));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue