Check for type availability since new create form

pull/6827/head
Oliver Günther 9 years ago
parent ceb0cfcc99
commit 070292462e
  1. 4
      lib/open_project/backlogs/engine.rb

@ -139,7 +139,7 @@ module OpenProject::Backlogs
extend_api_response(:v3, :work_packages, :work_package) do
property :story_points,
render_nil: true,
if: -> (*) { backlogs_enabled? && type.story? }
if: -> (*) { backlogs_enabled? && type && type.story? }
property :remaining_time,
exec_context: :decorator,
@ -154,7 +154,7 @@ module OpenProject::Backlogs
extend_api_response(:v3, :work_packages, :work_package_payload) do
property :story_points,
render_nil: true,
if: -> (*) { backlogs_enabled? && type.story? }
if: -> (*) { backlogs_enabled? && type && type.story? }
property :remaining_time,
exec_context: :decorator,

Loading…
Cancel
Save