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

[#53993] improved code readability

Eric Schuberta7e9313a6a2d
diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/internal/delete_entity_command.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/internal/delete_entity_command.rb
index 08d63fd83af..8e70bf5f8f2 100644
--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/internal/delete_entity_command.rb
+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/internal/delete_entity_command.rb
@@ -77,12 +77,14 @@ module Storages::Peripherals::StorageInteraction::Nextcloud::Internal
when :basic_auth
ServiceResult.success(result: @storage.username)
when :oauth_user_token
- origin_user_id = OAuthClientToken.find_by(user_id: user, oauth_client_id: @storage.oauth_client.id)&.origin_user_id
- origin_user_id.present? ?
- ServiceResult.success(result: origin_user_id) :
+ origin_user_id = OAuthClientToken.find_by(user_id: user, oauth_client: @storage.oauth_client)&.origin_user_id
+ if origin_user_id.present?
+ ServiceResult.success(result: origin_user_id)
+ else
failure(code: :error,
payload: nil,
log_message: "No origin user ID or user token found. Cannot execute query without user context.")
+ end
else
failure(code: :error,
payload: nil,