(20250117) Major revamping in the mail module. Everything revamped. Sending is a pending task.
This commit is contained in:
@@ -149,12 +149,12 @@ class CoreMessageModel(BaseModel):
|
||||
default = False
|
||||
)
|
||||
|
||||
sender: str | None = Field(
|
||||
sender: List[str] | None = Field(
|
||||
description = "the name of the sender; null if you are the sender",
|
||||
frozen = True
|
||||
)
|
||||
|
||||
recipient: str | None = Field(
|
||||
recipient: List[str] | None = Field(
|
||||
description = "the name of the recipient; null if you are the recipient",
|
||||
frozen = True,
|
||||
default = None
|
||||
@@ -260,6 +260,12 @@ class CoreMessageModel(BaseModel):
|
||||
except: pass
|
||||
return value
|
||||
|
||||
@field_validator("sender", "recipient", mode = "before")
|
||||
def validate_participants(cls, value):
|
||||
if value is None: value = []
|
||||
if isinstance(value, str): value = [value]
|
||||
return value
|
||||
|
||||
@field_validator("tags", mode = "before")
|
||||
def validate_tags(cls, value):
|
||||
if value is None: value = []
|
||||
|
||||
Reference in New Issue
Block a user