]> cat aescling's git repositories - mastodon.git/commitdiff
Add locale param to sign-up API (#9747)
authorEugen Rochko <eugen@zeonfederated.com>
Mon, 7 Jan 2019 13:50:20 +0000 (14:50 +0100)
committerGitHub <noreply@github.com>
Mon, 7 Jan 2019 13:50:20 +0000 (14:50 +0100)
Fix #9627

app/controllers/api/v1/accounts_controller.rb
app/services/app_sign_up_service.rb

index 6e4084c4e339f51830728f2b047a56f788b4f58a..2ccbc3cbbdf50e1d64cd6292a3bdb133b29759c5 100644 (file)
@@ -76,7 +76,7 @@ class Api::V1::AccountsController < Api::BaseController
   end
 
   def account_params
-    params.permit(:username, :email, :password, :agreement)
+    params.permit(:username, :email, :password, :agreement, :locale)
   end
 
   def check_enabled_registrations
index 1878587e8091895d781d05aaa4949d2a3ddb9d2a..d621cc462c6460af70157690c1524cb42a0f2735 100644 (file)
@@ -4,7 +4,7 @@ class AppSignUpService < BaseService
   def call(app, params)
     return unless allowed_registrations?
 
-    user_params    = params.slice(:email, :password, :agreement)
+    user_params    = params.slice(:email, :password, :agreement, :locale)
     account_params = params.slice(:username)
     user           = User.create!(user_params.merge(created_by_application: app, password_confirmation: user_params[:password], account_attributes: account_params))