X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/0837205d0285d47af0635a88eef4be7152f5f27c..732e1ab03a3b0f003dd8dc10e505d8d952fa18b9:/app/controllers/user_controller.rb diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index e7dccd8f1..d250cf21c 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -297,9 +297,7 @@ class UserController < ApplicationController user = token.user user.status = "active" user.email_valid = true - if (gravatar_enable(user)) - flash[:notice] = gravatar_status_message(user) - end + flash[:notice] = gravatar_status_message(user) if gravatar_enable(user) user.save! referer = token.referer token.destroy @@ -351,9 +349,13 @@ class UserController < ApplicationController @user.email = @user.new_email @user.new_email = nil @user.email_valid = true - changed = gravatar_enable(@user) + gravatar_enabled = gravatar_enable(@user) if @user.save - flash[:notice] = (t "user.confirm_email.success") + (changed ? " " + gravatar_status_message(@user) : "") + flash[:notice] = if gravatar_enabled + t("user.confirm_email.success") + " " + gravatar_status_message(@user) + else + t("user.confirm_email.success") + end else flash[:errors] = @user.errors end @@ -814,7 +816,7 @@ class UserController < ApplicationController response = OSM.http_client.get(URI.parse(url)) oldsetting = user.image_use_gravatar user.image_use_gravatar = response.success? - return oldsetting != user.image_use_gravatar + oldsetting != user.image_use_gravatar end ##