refactor: simplify code formatting and improve readability across multiple files
This commit is contained in:
@@ -36,12 +36,8 @@ class BoardOnboardingConfirm(SQLModel):
|
||||
@model_validator(mode="after")
|
||||
def validate_goal_fields(self) -> Self:
|
||||
"""Require goal metadata when the board type is `goal`."""
|
||||
if self.board_type == "goal" and (
|
||||
not self.objective or not self.success_metrics
|
||||
):
|
||||
message = (
|
||||
"Confirmed goal boards require objective and success_metrics"
|
||||
)
|
||||
if self.board_type == "goal" and (not self.objective or not self.success_metrics):
|
||||
message = "Confirmed goal boards require objective and success_metrics"
|
||||
raise ValueError(message)
|
||||
return self
|
||||
|
||||
|
||||
@@ -9,9 +9,7 @@ from uuid import UUID
|
||||
from pydantic import model_validator
|
||||
from sqlmodel import SQLModel
|
||||
|
||||
_ERR_GOAL_FIELDS_REQUIRED = (
|
||||
"Confirmed goal boards require objective and success_metrics"
|
||||
)
|
||||
_ERR_GOAL_FIELDS_REQUIRED = "Confirmed goal boards require objective and success_metrics"
|
||||
_ERR_GATEWAY_REQUIRED = "gateway_id is required"
|
||||
RUNTIME_ANNOTATION_TYPES = (datetime, UUID)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user