Skip to content

Commit

Permalink
Adjust redirect URL for file deletion in a SAC (#4420)
Browse files Browse the repository at this point in the history
* Update views.py

Addresses any potentially invalid redirect URL (from user input) with django's factory routine for validating URLs.

* Linting
  • Loading branch information
rnovak338 authored Oct 29, 2024
1 parent f50d9cc commit 89aee00
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/report_submission/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 89aee00

Please sign in to comment.