From 9eb56de76140b1c826a88cf0004c85c71b4fe074 Mon Sep 17 00:00:00 2001 From: paulmwatson Date: Thu, 11 Apr 2024 13:56:09 +0200 Subject: [PATCH] Sentry capture message with file download --- pmg/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pmg/utils.py b/pmg/utils.py index ceebdad0..e20305f6 100644 --- a/pmg/utils.py +++ b/pmg/utils.py @@ -6,7 +6,7 @@ from flask_security import current_user import requests import json -import os +from sentry_sdk import capture_message # Useragents that are bots BOTS_RE = re.compile("(bot|spider|cloudfront|slurp)", re.I) @@ -93,6 +93,7 @@ def track_file_download(): } ], } + capture_message(f"File download: {path}", payload) requests.post(url, data=json.dumps(payload), verify=True) return True