0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Merge pull request #3576 from morficus/issue-3523

Error modifying "author" attribute before post record has been created
This commit is contained in:
Hannah Wolfe 2014-08-03 17:24:09 +01:00
commit a1dad7b59d

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);