Skip to content

Commit 75d45a7

Browse files
authored
Merge pull request #7553 from opsmill/pog-hashablemodel-field
Define defaults with Field in HashableModel
2 parents c426e3f + 6cd059b commit 75d45a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/infrahub/core/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,8 @@ def has_diff(self) -> bool:
404404
class HashableModel(BaseModel):
405405
model_config = ConfigDict(extra="forbid")
406406

407-
id: str | None = None
408-
state: HashableModelState = HashableModelState.PRESENT
407+
id: str | None = Field(default=None)
408+
state: HashableModelState = Field(default=HashableModelState.PRESENT)
409409

410410
_exclude_from_hash: list[str] = []
411411
_sort_by: list[str] = []

0 commit comments

Comments
 (0)