From 582d13a292f56e7d6294fb636b1aeb4228b98426 Mon Sep 17 00:00:00 2001 From: Andrew Cain Date: Mon, 8 Jan 2024 09:33:42 +1100 Subject: [PATCH] fix: ensure we can get the report url for moss reports --- app/api/entities/task_definition_entity.rb | 1 - app/api/similarity/task_similarity_api.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/api/entities/task_definition_entity.rb b/app/api/entities/task_definition_entity.rb index efd043e57..780dc5c83 100644 --- a/app/api/entities/task_definition_entity.rb +++ b/app/api/entities/task_definition_entity.rb @@ -34,7 +34,6 @@ def staff?(my_role) task_definition.tutorial_stream.abbreviation unless task_definition.tutorial_stream.nil? end expose :plagiarism_checks, if: ->(unit, options) { staff?(options[:my_role]) } - expose :plagiarism_report_url, if: ->(unit, options) { staff?(options[:my_role]) } expose :plagiarism_warn_pct, if: ->(unit, options) { staff?(options[:my_role]) } expose :restrict_status_updates, if: ->(unit, options) { staff?(options[:my_role]) } expose :group_set_id diff --git a/app/api/similarity/task_similarity_api.rb b/app/api/similarity/task_similarity_api.rb index e7a4afbd4..032de27a1 100644 --- a/app/api/similarity/task_similarity_api.rb +++ b/app/api/similarity/task_similarity_api.rb @@ -116,7 +116,7 @@ class TaskSimilarityApi < Grape::API error!({ error: "Similarity report is not yet ready to be viewed for this submission" }, 404) end else - error!({ error: "No details to download for task '#{params[:id]}'" }, 404) + similarity.plagiarism_report_url end end end