diff options
Diffstat (limited to 'backend/models')
| -rw-r--r-- | backend/models/form.py | 10 | 
1 files changed, 10 insertions, 0 deletions
| diff --git a/backend/models/form.py b/backend/models/form.py index 739464e..70a77a9 100644 --- a/backend/models/form.py +++ b/backend/models/form.py @@ -24,6 +24,7 @@ class _WebHook(BaseModel):      url: str      message: str | None +    thread_id: str | None = None      @validator("url")      def validate_url(cls, url: str) -> str: @@ -34,6 +35,15 @@ class _WebHook(BaseModel):          return url +    @validator("thread_id") +    def validate_thread_id(cls, thread_id: str | None) -> str | None: +        """Validates thread_id parameter.""" +        if thread_id is not None and not thread_id.isdigit(): +            msg = "Thread ID must be a string of digits." +            raise ValueError(msg) + +        return thread_id +  class Form(BaseModel):      """Schema model for form.""" | 
