Skip to content

Commit 76221fc

Browse files
Adjusted check to include finding evidence
This is temporary until PR #790 is merged.
1 parent 147030a commit 76221fc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ghostwriter/api/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,8 @@ def post(self, request, *args, **kwargs):
948948
)
949949

950950
# Verify evidence belongs to the same project via its report
951-
if evidence.report and evidence.report.project != entry.oplog_id.project:
951+
# TODO: Update this check when we remove finding evidence links with PR #790
952+
if evidence.report or evidence.finding and evidence.associated_report.project.project != entry.oplog_id.project:
952953
return JsonResponse(
953954
utils.generate_hasura_error_payload(
954955
"Evidence does not belong to the same project", "ProjectMismatch"

0 commit comments

Comments
 (0)