diff --git a/services/web/app/coffee/Features/User/UserController.coffee b/services/web/app/coffee/Features/User/UserController.coffee index bb3ed6be55..4501594164 100644 --- a/services/web/app/coffee/Features/User/UserController.coffee +++ b/services/web/app/coffee/Features/User/UserController.coffee @@ -44,7 +44,7 @@ module.exports = user.ace.pdfViewer = req.body.pdfViewer user.save (err)-> if !newEmail? or newEmail.length == 0 or newEmail.indexOf("@") == -1 - return res.send(412) + return res.send(400) else if newEmail == user.email return res.send 200 else diff --git a/services/web/test/UnitTests/coffee/User/UserControllerTests.coffee b/services/web/test/UnitTests/coffee/User/UserControllerTests.coffee index cfdb1c7f10..701b2d286a 100644 --- a/services/web/test/UnitTests/coffee/User/UserControllerTests.coffee +++ b/services/web/test/UnitTests/coffee/User/UserControllerTests.coffee @@ -107,21 +107,21 @@ describe "UserController", -> it "should return an error if the email address is null", (done)-> @req.body.email = null @res.send = (code)-> - code.should.equal 412 + code.should.equal 400 done() @UserController.updateUserSettings @req, @res it "should send an error if the email is 0 len", (done)-> @req.body.email = "" @res.send = (code)-> - code.should.equal 412 + code.should.equal 400 done() @UserController.updateUserSettings @req, @res it "should send an error if the email does not contain an @", (done)-> @req.body.email = "bob at something dot com" @res.send = (code)-> - code.should.equal 412 + code.should.equal 400 done() @UserController.updateUserSettings @req, @res