leave context host for attachment_json in reports
attachment_json will do this for you. this prevents double context information from the merge of options in attachment_json refs CNVS-10842 test plan - run report with canvas on port 3000 - report object response should have the correct attachment download url Change-Id: I58caffede266dee157afab63fd82a0a4a4bd5213 Reviewed-on: https://gerrit.instructure.com/40638 QA-Review: Dave Jungst <dave@instructure.com> Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Jeremy Stanley <jeremy@instructure.com> Product-Review: Rob Orton <rob@instructure.com>
This commit is contained in:
parent
63945c4d35
commit
7f6f5b16c9
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2012 - 2013 Instructure, Inc.
|
||||
# Copyright (C) 2012 - 2014 Instructure, Inc.
|
||||
#
|
||||
# This file is part of Canvas.
|
||||
#
|
||||
|
@ -28,13 +28,13 @@ module Api::V1::AccountReport
|
|||
|
||||
def account_report_json(report, user, session)
|
||||
json = api_json(report, user, session,
|
||||
:only => %w(id progress parameters)
|
||||
:only => %w(id progress parameters)
|
||||
)
|
||||
json[:status] = report.workflow_state
|
||||
json[:report] = report.report_type
|
||||
json[:file_url] = (report.attachment.nil? ? nil : "https://#{HostUrl.context_host(report.account.root_account)}/accounts/#{report.account_id}/files/#{report.attachment.id}/download")
|
||||
if report.attachment
|
||||
json[:attachment] = attachment_json(report.attachment, user, :host => HostUrl.context_host(report.account.root_account))
|
||||
json[:attachment] = attachment_json(report.attachment, user)
|
||||
end
|
||||
json
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue