Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Revert create user api to use authSource for backwards compatibility.

Dombi Attilaeb7fa7f507b1
diff --git a/app/contracts/users/base_contract.rb b/app/contracts/users/base_contract.rb
index d2c36422b95..a28ddcd0ec1 100644
--- a/app/contracts/users/base_contract.rb
+++ b/app/contracts/users/base_contract.rb
@@ -91,7 +91,7 @@ module Users
# rubocop:disable Rails/DynamicFindBy
def existing_auth_source
if ldap_auth_source_id && LdapAuthSource.find_by_unique(ldap_auth_source_id).nil?
- errors.add :ldap_auth_source, :error_not_found
+ errors.add :auth_source, :error_not_found
end
end
# rubocop:enable Rails/DynamicFindBy
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 4b70662ecad..b9f82579c7d 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1024,6 +1024,8 @@ en:
invalid_on_create: "is not a valid status for new users."
ldap_auth_source:
error_not_found: "not found"
+ auth_source:
+ error_not_found: "not found"
member:
principal_blank: "Please choose at least one user or group."
role_blank: "need to be assigned."
diff --git a/spec/requests/api/v3/user/create_user_resource_spec.rb b/spec/requests/api/v3/user/create_user_resource_spec.rb
index 272b606abf4..a07fa09d021 100644
--- a/spec/requests/api/v3/user/create_user_resource_spec.rb
+++ b/spec/requests/api/v3/user/create_user_resource_spec.rb
@@ -117,7 +117,7 @@ RSpec.describe API::V3::Users::UsersAPI do
expect(last_response.status).to eq(422)
expect(last_response.body)
- .to be_json_eql('ldapAuthSource'.to_json)
+ .to be_json_eql('authSource'.to_json)
.at_path('_embedded/details/attribute')
expect(last_response.body)