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

be more explicit about condition and getter

ulferts15136f417c66
diff --git a/lib/api/v3/work_packages/work_package_representer.rb b/lib/api/v3/work_packages/work_package_representer.rb
index 38ca0c82a0b..4438c410415 100644
--- a/lib/api/v3/work_packages/work_package_representer.rb
+++ b/lib/api/v3/work_packages/work_package_representer.rb
@@ -430,10 +430,9 @@ module API
property :readonly,
writeable: false,
render_nil: false,
+ if: ->(*) { ::Status.can_readonly? },
getter: ->(*) do
- if status_id && ::Status.can_readonly?
- status.is_readonly?
- end
+ status_id && status.is_readonly?
end
associated_resource :category