Skip to content

Commit

Permalink
Fix crash when SENTRY_ENABLED is undefined
Browse files Browse the repository at this point in the history
Otherwise eval_bool is called on x where x is None, leading to
None.lower() which causes:

AttributeError: 'NoneType' object has no attribute 'lower'
  • Loading branch information
staticfox committed Dec 29, 2024
1 parent 6675259 commit d72b100
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fm_eventmanager/settings.py.docker
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ from idempotency_key import status

eval_bool = lambda x: x.lower() in ('true', '1', 't', 'y', 'yes')

SENTRY_ENABLED = eval_bool(os.environ.get("SENTRY_ENABLED"))
SENTRY_ENABLED = eval_bool(os.environ.get("SENTRY_ENABLED", ""))
if SENTRY_ENABLED:
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
Expand Down

0 comments on commit d72b100

Please sign in to comment.