summaryrefslogtreecommitdiff
path: root/users/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'users/app/controllers')
-rw-r--r--users/app/controllers/users_controller.rb3
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