Skip to content

Commit b0aa7ae

Browse files
committed
added patch
1 parent ff36d2c commit b0aa7ae

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

backend/pennmobile/settings/production.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22

33
import sentry_sdk
4+
from sentry_sdk import Event, Hint
45
from sentry_sdk.integrations.celery import CeleryIntegration
56
from sentry_sdk.integrations.django import DjangoIntegration
67

@@ -21,7 +22,23 @@
2122

2223
# Sentry settings
2324
SENTRY_URL = os.environ.get("SENTRY_URL", "")
24-
sentry_sdk.init(dsn=SENTRY_URL, integrations=[CeleryIntegration(), DjangoIntegration()])
25+
26+
27+
def before_send(event: Event, hint: Hint) -> Event | None:
28+
if (
29+
"logentry" in event
30+
and "message" in event["logentry"]
31+
and "Wharton: Error 403 when reserving data" in event["logentry"]["message"]
32+
):
33+
return None
34+
return event
35+
36+
37+
sentry_sdk.init(
38+
dsn=SENTRY_URL,
39+
integrations=[CeleryIntegration(), DjangoIntegration()],
40+
before_send=before_send,
41+
)
2542

2643
# DLA settings
2744
PLATFORM_ACCOUNTS = {"ADMIN_PERMISSION": "penn_mobile_admin"}

0 commit comments

Comments
 (0)