Commit e76c195e authored by Robert Speicher's avatar Robert Speicher

Merge branch '24730-broken-master' into 'master'

Fix StrongAttibutes error with Ruby 2.1

Closes #24730

See merge request !7625
parents 56b420ae 039d4a1c
No related merge requests found
...@@ -140,7 +140,8 @@ module API ...@@ -140,7 +140,8 @@ module API
User.where(username: params[:username]). User.where(username: params[:username]).
where.not(id: user.id).count > 0 where.not(id: user.id).count > 0
identity_attrs = params.slice(:provider, :extern_uid) user_params = declared_params(include_missing: false)
identity_attrs = user_params.slice(:provider, :extern_uid)
if identity_attrs.any? if identity_attrs.any?
identity = user.identities.find_by(provider: identity_attrs[:provider]) identity = user.identities.find_by(provider: identity_attrs[:provider])
...@@ -154,10 +155,10 @@ module API ...@@ -154,10 +155,10 @@ module API
end end
# Delete already handled parameters # Delete already handled parameters
params.delete(:extern_uid) user_params.delete(:extern_uid)
params.delete(:provider) user_params.delete(:provider)
if user.update_attributes(declared_params(include_missing: false)) if user.update_attributes(user_params)
present user, with: Entities::UserFull present user, with: Entities::UserFull
else else
render_validation_error!(user) render_validation_error!(user)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment