Skip to content

Commit 476e538

Browse files
fix env list parsing
1 parent 85eb86f commit 476e538

File tree

1 file changed

+8
-1
lines changed
  • packages/settings-library/src/settings_library

1 file changed

+8
-1
lines changed

packages/settings-library/src/settings_library/twilio.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from typing import Annotated, TypeAlias
1010

11-
from pydantic import Field, StringConstraints, TypeAdapter
11+
from pydantic import Field, StringConstraints, TypeAdapter, field_validator
1212

1313
from .base import BaseCustomSettings
1414

@@ -30,6 +30,13 @@ class TwilioSettings(BaseCustomSettings):
3030
"See https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID",
3131
)
3232

33+
34+
@field_validator("TWILIO_COUNTRY_CODES_W_ALPHANUMERIC_SID_SUPPORT", mode="before")
35+
@classmethod
36+
def _parse_country_codes_from_env(cls, v):
37+
return [str(cc) for cc in v]
38+
39+
3340
def is_alphanumeric_supported(self, phone_number: str) -> bool:
3441
# Some countries do not support alphanumeric serder ID
3542
#

0 commit comments

Comments
 (0)