diff options
author | azul <azul@riseup.net> | 2013-01-17 22:45:39 -0800 |
---|---|---|
committer | azul <azul@riseup.net> | 2013-01-17 22:45:39 -0800 |
commit | 168c36b578d675c99aad62a350aa68cc1b6d1316 (patch) | |
tree | cd1df0a9a7d3f0a9812b512cfb93db0f79b0421f /users/app/controllers/users_controller.rb | |
parent | 19d563e2e2db98ecc5143229f554df6a09bc457e (diff) | |
parent | 27730c7e665ed64e691fdf6dbeebc39c8bfbbc4b (diff) |
Merge pull request #18 from leapcode/feature/fixed-email-address
make email address just login@domain.tld
Diffstat (limited to 'users/app/controllers/users_controller.rb')
-rw-r--r-- | users/app/controllers/users_controller.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/users/app/controllers/users_controller.rb b/users/app/controllers/users_controller.rb index c0fe243..6cb438b 100644 --- a/users/app/controllers/users_controller.rb +++ b/users/app/controllers/users_controller.rb @@ -35,9 +35,10 @@ class UsersController < ApplicationController def update @user.attributes = params[:user] - @email_alias = @user.email_aliases.last if @user.changed? and @user.save flash[:notice] = t(:user_updated_successfully) + elsif !@user.email_aliases.last.valid? + @email_alias = @user.email_aliases.pop end respond_with @user, :location => edit_user_path(@user, :anchor => @anchor) end |