From 65dd571041408712ab2fb2efd0f4a0ae73a8df34 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Fri, 20 Nov 2015 15:17:04 -0800 Subject: [PATCH] Fix StudentLoginModal when email or password is not included --- app/views/courses/StudentLogInModal.coffee | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/views/courses/StudentLogInModal.coffee b/app/views/courses/StudentLogInModal.coffee index 6bc50e041..28d92c58b 100644 --- a/app/views/courses/StudentLogInModal.coffee +++ b/app/views/courses/StudentLogInModal.coffee @@ -20,13 +20,11 @@ module.exports = class StudentSignInModal extends ModalView @login() login: -> - userObject = forms.formToObject @$el - res = tv4.validateMultiple userObject, User.schema - return forms.applyErrorsToForm(@$el, res.errors) unless res.valid + data = forms.formToObject @$el @enableModalInProgress(@$el) - auth.loginUser userObject, (jqxhr) => + auth.loginUser data, (jqxhr) => error = jqxhr.responseJSON[0] - message = error.property + ' ' + error.message + message = _.filter([error.property, error.message]).join(' ') @disableModalInProgress(@$el) @$('#errors-alert').text(message).removeClass('hide') \ No newline at end of file