fix: allow draft goal boards

This commit is contained in:
Abhimanyu Saharan
2026-02-05 15:00:20 +05:30
parent 8ed5036af1
commit d29a3f5cda
2 changed files with 16 additions and 4 deletions

View File

@@ -22,9 +22,11 @@ class BoardBase(SQLModel):
class BoardCreate(BoardBase):
@model_validator(mode="after")
def validate_goal_fields(self):
if self.board_type == "goal":
if self.board_type == "goal" and self.goal_confirmed:
if not self.objective or not self.success_metrics:
raise ValueError("Goal boards require objective and success_metrics")
raise ValueError(
"Confirmed goal boards require objective and success_metrics"
)
return self