From 98ec5db6ebdac6a4cb954357b59849ac58145b5a Mon Sep 17 00:00:00 2001 From: Hung Nguyen Date: Thu, 16 Jan 2025 17:50:14 +0700 Subject: [PATCH] GRIF-63: Users brick fails if updating users with credentials not change --- VERSION | 2 +- lib/gooddata/models/domain.rb | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 326e2acf6..9e0ce6fc4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.7.75 +3.7.76 diff --git a/lib/gooddata/models/domain.rb b/lib/gooddata/models/domain.rb index e7b94d933..3a6093bce 100644 --- a/lib/gooddata/models/domain.rb +++ b/lib/gooddata/models/domain.rb @@ -284,12 +284,16 @@ def create_users(list, default_domain = nil, opts = { :client => GoodData.connec [{ type: :successful, :action => :user_changed_in_domain, user: updated_user }] end rescue RuntimeError => e + error_message = e.message + user.delete(:password) if !domain_user - GoodData.logger.error("Failed to add user=#{user_login} to domain=#{default_domain_name}. Error: #{e.message}") + GoodData.logger.error("Failed to add user=#{user_login} to domain=#{default_domain_name}. Error: #{error_message}") else - GoodData.logger.error("Failed to update user=#{user_login} in domain=#{default_domain_name}. Error: #{e.message}") + error_message = 'Invalid user data or update new password cannot be the same as old password' if error_message == '400 Bad Request' + + GoodData.logger.error("Failed to update user=#{user_login} in domain=#{default_domain_name}. Error: #{error_message}") end - [{ type: :failed, :user => user, message: e }] + [{ type: :failed, :user => user, message: error_message }] end end end