Skip to content

Commit

Permalink
fix: Update omnivoreql/models.py with validation
Browse files Browse the repository at this point in the history
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
  • Loading branch information
yazdipour and sourcery-ai[bot] authored Jun 16, 2024
1 parent 9a2f3cb commit bc8e089
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions omnivoreql/models.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
from dataclasses import dataclass
from typing import Optional

from dataclasses import dataclass, field
from typing import Optional

@dataclass
class CreateLabelInput:
name: str
color: str
name: str = field(default="", metadata={"validate": lambda x: isinstance(x, str) and bool(x.strip())})
color: str = field(default="", metadata={"validate": lambda x: isinstance(x, str) and bool(x.strip())})
description: Optional[str] = None

0 comments on commit bc8e089

Please sign in to comment.