diff options
author | Logan Fick <logaldeveloper@protonmail.com> | 2017-10-28 13:49:36 -0400 |
---|---|---|
committer | Logan Fick <logaldeveloper@protonmail.com> | 2017-10-28 13:49:36 -0400 |
commit | b1f739f6f8a1778151a80696819ce6ae6ea2c477 (patch) | |
tree | c00d0c6bc0df6e222b58b81118cbfeb1b55af704 | |
parent | 577961d122edb3352c7a62e9175fa1bfdaeecc3b (diff) |
Fixed the inability to update profile when not changing name.
-rw-r--r-- | app/controllers/users_controller.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 4890a98..366ba1a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -141,7 +141,7 @@ class UsersController < ApplicationController else userdata = user_params([:name, :skype, :youtube, :twitter, :about, :header_scroll, :utc_time, :dark]) end - if User.find_by(name: userdata[:name]) + if User.find_by(name: userdata[:name]) && User.find_by(name: userdata[:name]) != current_user flash[:alert] = "You have entered a name that belongs to someone else. Please try another." redirect_to edit_user_path(@user) return |