Skip to content

Commit

Permalink
Merge pull request #519 from OpenUpSA/dev/log-track_file_download
Browse files Browse the repository at this point in the history
Sentry capture message with file download
  • Loading branch information
paulmwatson authored Apr 11, 2024
2 parents 75d438a + 9eb56de commit e943caf
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 e943caf

Please sign in to comment.