Skip to content

Commit 48c7827

Browse files
Merge pull request #2000 from gooddata/GRIF-63
GRIF-63: Users brick fails if updating users with credentials not change
2 parents f8adbc8 + 98ec5db commit 48c7827

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.7.75
1+
3.7.76

lib/gooddata/models/domain.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,12 +284,16 @@ def create_users(list, default_domain = nil, opts = { :client => GoodData.connec
284284
[{ type: :successful, :action => :user_changed_in_domain, user: updated_user }]
285285
end
286286
rescue RuntimeError => e
287+
error_message = e.message
288+
user.delete(:password)
287289
if !domain_user
288-
GoodData.logger.error("Failed to add user=#{user_login} to domain=#{default_domain_name}. Error: #{e.message}")
290+
GoodData.logger.error("Failed to add user=#{user_login} to domain=#{default_domain_name}. Error: #{error_message}")
289291
else
290-
GoodData.logger.error("Failed to update user=#{user_login} in domain=#{default_domain_name}. Error: #{e.message}")
292+
error_message = 'Invalid user data or update new password cannot be the same as old password' if error_message == '400 Bad Request'
293+
294+
GoodData.logger.error("Failed to update user=#{user_login} in domain=#{default_domain_name}. Error: #{error_message}")
291295
end
292-
[{ type: :failed, :user => user, message: e }]
296+
[{ type: :failed, :user => user, message: error_message }]
293297
end
294298
end
295299
end

0 commit comments

Comments
 (0)