0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Error modifying "author" attribute before post record has been created

fixes #3523
- when changing the author, added a check to NOT trigger a save if the post has not been created/saved as yet
This commit is contained in:
Maurice Williams 2014-08-02 14:27:12 -04:00
parent ec1dc0e24a
commit 6ee5ba2291

View file

@ -24,6 +24,12 @@ var PostSettingsMenuController = Ember.ObjectController.extend({
return; return;
} }
model.set('author', selectedAuthor); model.set('author', selectedAuthor);
//if this is a new post (never been saved before), don't try to save it
if (this.get('isNew')) {
return;
}
model.save(this.get('saveOptions')).catch(function (errors) { model.save(this.get('saveOptions')).catch(function (errors) {
self.showErrors(errors); self.showErrors(errors);
self.set('selectedAuthor', author); self.set('selectedAuthor', author);