From: Sungmin Kim Date: Fri, 30 Aug 2013 01:27:05 +0000 (+0900) Subject: [Title] Add error message when sign up about exist email account. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a528f8e405df5f8efba444fcb9edef18ed2ca103;p=sdk%2Ftools%2Fsdk-build.git [Title] Add error message when sign up about exist email account. --- diff --git a/dibs-web/app/controllers/users_controller.rb b/dibs-web/app/controllers/users_controller.rb index 0b830a1..1d02f78 100644 --- a/dibs-web/app/controllers/users_controller.rb +++ b/dibs-web/app/controllers/users_controller.rb @@ -52,6 +52,11 @@ class UsersController < ApplicationController @user.password = change_item[:Password] @user.password_confirmation = change_item[:PasswordConfirm] + if not User.find_by_email(@user.email).nil? then + render :json => { :error => "Already exist email account."}, :status => 406 + return + end + if @user.save create_session(@user.email, @user.password) else