refactor: simplify code formatting and improve readability across multiple files

This commit is contained in:
Abhimanyu Saharan
2026-02-09 20:44:05 +05:30
parent 020d02fa22
commit 8f6347dc8d
33 changed files with 393 additions and 427 deletions

View File

@@ -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

View File

@@ -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)