From 89aee007b519ac07497135b211d451f2728f71f4 Mon Sep 17 00:00:00 2001 From: Bobby Novak <176936850+rnovak338@users.noreply.github.com> Date: Tue, 29 Oct 2024 16:16:25 -0400 Subject: [PATCH] Adjust redirect URL for file deletion in a SAC (#4420) * Update views.py Addresses any potentially invalid redirect URL (from user input) with django's factory routine for validating URLs. * Linting --- backend/report_submission/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/report_submission/views.py b/backend/report_submission/views.py index df197b533..7126e2c37 100644 --- a/backend/report_submission/views.py +++ b/backend/report_submission/views.py @@ -608,7 +608,9 @@ def post(self, request, *args, **kwargs): ) logger.info("The file has been successfully deleted.") - return redirect(f"/audit/submission-progress/{report_id}") + return Util.validate_redirect_url( + f"/audit/submission-progress/{sac.report_id}" + ) except SingleAuditChecklist.DoesNotExist: logger.error(f"Audit: {report_id} not found")