Remap status_attributes from representable back to status

pull/7756/head
Oliver Günther 5 years ago
parent 60ba6284a1
commit 4963a9b0e1
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 5
      app/services/projects/set_attributes_service.rb
  2. 5
      lib/api/v3/projects/project_representer.rb

@ -33,10 +33,7 @@ module Projects
private
def set_attributes(attributes)
# Delete the status attribute which gets set by representable
# IFF the status_code is given as null
attributes.delete(:status)
status_attributes = attributes.delete(:status_attributes) || {}
status_attributes = attributes.delete(:status) || {}
ret = super(attributes)

@ -50,7 +50,10 @@ module API
# Representable is broken when passing nil as parameters
# it will set the property :status and :statusExplanation
# regardless of what the setter actually does
super.except(:status, :statusExplanation)
super.tap do |result|
result.except!(:status, :statusExplanation)
result[:status] = result.delete(:status_attributes) if result.key?(:status_attributes)
end
end
link :createWorkPackage,

Loading…
Cancel
Save