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

Hack `writable_attributes` to allow `status` as a writable property

Aaron Contreras5a83bab012f7
diff --git a/lib/api/v3/projects/copy/project_copy_payload_representer.rb b/lib/api/v3/projects/copy/project_copy_payload_representer.rb
index 70c1e43d8a8..18563d0573a 100644
--- a/lib/api/v3/projects/copy/project_copy_payload_representer.rb
+++ b/lib/api/v3/projects/copy/project_copy_payload_representer.rb
@@ -39,6 +39,10 @@ module API
def meta_representer_class
ProjectCopyMetaRepresenter
end
+
+ def writable_attributes
+ super + %w[status]
+ end
end
end
end
diff --git a/lib/api/v3/projects/project_payload_representer.rb b/lib/api/v3/projects/project_payload_representer.rb
index 0956a775daa..079b35e5a35 100644
--- a/lib/api/v3/projects/project_payload_representer.rb
+++ b/lib/api/v3/projects/project_payload_representer.rb
@@ -33,6 +33,10 @@ module API
include ::API::Utilities::PayloadRepresenter
cached_representer disabled: true
+
+ def writable_attributes
+ super + %w[status]
+ end
end
end
end
diff --git a/lib/api/v3/projects/project_representer.rb b/lib/api/v3/projects/project_representer.rb
index 3cb4def0416..27a8eba2bde 100644
--- a/lib/api/v3/projects/project_representer.rb
+++ b/lib/api/v3/projects/project_representer.rb
@@ -216,8 +216,7 @@ module API
link.from_hash(fragment)
}
- formattable_property :status_explanation,
- writable: -> { represented.writable?(:status) }
+ formattable_property :status_explanation
def _type
'Project'