Skip to content

Commit

Permalink
Sentry capture message with file download
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmwatson committed Apr 11, 2024
1 parent 75d438a commit 9eb56de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pmg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9eb56de

Please sign in to comment.