mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-07-25 12:01:04 +02:00
chore: incorporate review comments
This commit is contained in:
parent
e486920db2
commit
fdc181e75d
11 changed files with 215 additions and 152 deletions
|
|
@ -258,7 +258,10 @@ class ContextDestinationMappingConfig(BaseModel):
|
|||
@field_validator("context_path")
|
||||
@classmethod
|
||||
def strip_context_path(cls, value: str) -> str:
|
||||
return value.strip()
|
||||
stripped = value.strip()
|
||||
if not stripped:
|
||||
raise ValueError("context path cannot be blank")
|
||||
return stripped
|
||||
|
||||
@field_validator("fallback_destination")
|
||||
@classmethod
|
||||
|
|
|
|||
|
|
@ -22,15 +22,15 @@ class ExternalPBXFieldMapping(BaseModel):
|
|||
context_path: str = Field(min_length=1, max_length=255)
|
||||
destination_field: str = Field(pattern=r"^[A-Za-z][A-Za-z0-9_]{0,63}$")
|
||||
|
||||
@field_validator("context_path")
|
||||
@field_validator("context_path", mode="before")
|
||||
@classmethod
|
||||
def strip_context_path(cls, value: str) -> str:
|
||||
return value.strip()
|
||||
def strip_context_path(cls, value: object) -> object:
|
||||
return value.strip() if isinstance(value, str) else value
|
||||
|
||||
@field_validator("destination_field")
|
||||
@field_validator("destination_field", mode="before")
|
||||
@classmethod
|
||||
def strip_destination_field(cls, value: str) -> str:
|
||||
return value.strip()
|
||||
def strip_destination_field(cls, value: object) -> object:
|
||||
return value.strip() if isinstance(value, str) else value
|
||||
|
||||
|
||||
class AmbientNoiseConfigurationDefaults(BaseModel):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue