]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/users_controller.rb
Merge remote-tracking branch 'upstream/pull/3293'
[rails.git] / app / controllers / users_controller.rb
index 1f3eb2f7a87e1d170dc60306da91bedc27f5ea49..e3d5173a785f8510207194e9c9b5c38a1b166e46 100644 (file)
@@ -28,9 +28,9 @@ class UsersController < ApplicationController
 
       if current_user&.terms_agreed?
         # Already agreed to terms, so just show settings
-        redirect_to :action => :account, :display_name => current_user.display_name
+        redirect_to user_account_path(current_user)
       elsif current_user.nil? && session[:new_user].nil?
-        redirect_to :action => :login, :referer => request.fullpath
+        redirect_to login_path(:referer => request.fullpath)
       end
     end
   end
@@ -47,7 +47,7 @@ class UsersController < ApplicationController
         if params[:referer]
           redirect_to safe_referer(params[:referer])
         else
-          redirect_to :action => :account, :display_name => current_user.display_name
+          redirect_to user_account_path(current_user)
         end
       elsif params[:decline]
         redirect_to t("users.terms.declined")
@@ -67,7 +67,7 @@ class UsersController < ApplicationController
       if params[:referer]
         redirect_to safe_referer(params[:referer])
       else
-        redirect_to :action => :account, :display_name => current_user.display_name
+        redirect_to user_account_path(current_user)
       end
     else
       self.current_user = session.delete(:new_user)
@@ -147,7 +147,7 @@ class UsersController < ApplicationController
     current_user.data_public = true
     current_user.save
     flash[:notice] = t "users.go_public.flash success"
-    redirect_to :action => "account", :display_name => current_user.display_name
+    redirect_to user_account_path(current_user)
   end
 
   def new
@@ -297,7 +297,7 @@ class UsersController < ApplicationController
 
       session[:user_errors] = current_user.errors.as_json
 
-      redirect_to :action => "account", :display_name => current_user.display_name
+      redirect_to user_account_path(current_user)
     elsif session[:new_user]
       session[:new_user].auth_provider = provider
       session[:new_user].auth_uid = uid
@@ -363,26 +363,6 @@ class UsersController < ApplicationController
       user.pass_crypt_confirmation = params[:user][:pass_crypt_confirmation]
     end
 
-    if params[:user][:description] != user.description
-      user.description = params[:user][:description]
-      user.description_format = "markdown"
-    end
-
-    case params[:avatar_action]
-    when "new"
-      user.avatar.attach(params[:user][:avatar])
-      user.image_use_gravatar = false
-    when "delete"
-      user.avatar.purge_later
-      user.image_use_gravatar = false
-    when "gravatar"
-      user.avatar.purge_later
-      user.image_use_gravatar = true
-    end
-
-    user.home_lat = params[:user][:home_lat]
-    user.home_lon = params[:user][:home_lon]
-
     if params[:user][:auth_provider].nil? || params[:user][:auth_provider].blank?
       user.auth_provider = nil
       user.auth_uid = nil