Skip to content

Commit

Permalink
Add validation
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewelwell committed Jan 5, 2024
1 parent 64e897a commit 06537ef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/app/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import pytz
import requests
from corsheaders.defaults import default_headers
from django.core.exceptions import ImproperlyConfigured
from django.core.management.utils import get_random_secret_key
from environs import Env

Expand Down Expand Up @@ -1075,6 +1076,10 @@
LDAP_SYNC_USER_PASSWORD = env.str("LDAP_SYNC_USER_PASSWORD", None)

SEGMENT_CONDITION_VALUE_LIMIT = env.int("SEGMENT_CONDITION_VALUE_LIMIT", default=1000)
if not 0 <= SEGMENT_CONDITION_VALUE_LIMIT < 2000000:
raise ImproperlyConfigured(
"SEGMENT_CONDITION_VALUE_LIMIT must be between 0 and 2,000,000 (2MB)."
)

WEBHOOK_BACKOFF_BASE = env.int("WEBHOOK_BACKOFF_BASE", default=2)
WEBHOOK_BACKOFF_RETRIES = env.int("WEBHOOK_BACKOFF_RETRIES", default=3)

0 comments on commit 06537ef

Please sign in to comment.