fix(workflow_records): default category to WorkflowCategory.User

This allows old workflows to validate when reading them from the db or image files.
This commit is contained in:
psychedelicious
2023-12-05 22:54:48 +11:00
parent b056a9c181
commit 748f94e0e3

View File

@ -36,7 +36,9 @@ class WorkflowCategory(str, Enum, metaclass=MetaEnum):
class WorkflowMeta(BaseModel): class WorkflowMeta(BaseModel):
version: str = Field(description="The version of the workflow schema.") version: str = Field(description="The version of the workflow schema.")
category: WorkflowCategory = Field(description="The category of the workflow (user or default).") category: WorkflowCategory = Field(
default=WorkflowCategory.User, description="The category of the workflow (user or default)."
)
@field_validator("version") @field_validator("version")
def validate_version(cls, version: str): def validate_version(cls, version: str):