From c6bcefe6aeec04cfe5579cc941bc3aaa03c2cfc5 Mon Sep 17 00:00:00 2001 From: Rem Zolotykh Date: Wed, 8 Jul 2015 11:56:07 +0200 Subject: [PATCH] Invited user can sign up successfully issue #5525 - add `DS.Errors` to `signup` model - add check for errors: run `showErrors` method only if errors are defined, like in `signin` controller --- ghost/admin/app/controllers/signup.js | 4 +++- ghost/admin/app/routes/signup.js | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ghost/admin/app/controllers/signup.js b/ghost/admin/app/controllers/signup.js index 64f9b8f56f..77ea44a6be 100644 --- a/ghost/admin/app/controllers/signup.js +++ b/ghost/admin/app/controllers/signup.js @@ -45,7 +45,9 @@ export default Ember.Controller.extend(ValidationEngine, { }); }).catch(function (errors) { self.toggleProperty('submitting'); - notifications.showErrors(errors); + if (errors) { + notifications.showErrors(errors); + } }); } } diff --git a/ghost/admin/app/routes/signup.js b/ghost/admin/app/routes/signup.js index 369aafba5a..7527de9916 100644 --- a/ghost/admin/app/routes/signup.js +++ b/ghost/admin/app/routes/signup.js @@ -1,4 +1,5 @@ import Ember from 'ember'; +import DS from 'ember-data'; import {request as ajax} from 'ic-ajax'; import Configuration from 'simple-auth/configuration'; import styleBody from 'ghost/mixins/style-body'; @@ -35,6 +36,7 @@ export default Ember.Route.extend(styleBody, { model.set('email', email); model.set('token', params.token); + model.set('errors', DS.Errors.create()); return ajax({ url: self.get('ghostPaths.url').api('authentication', 'invitation'),