From c1b0aab2965dd8946be54bf8672fd3f66d843040 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Wed, 28 Jan 2026 19:17:24 +0000 Subject: [PATCH] Cleanup --- paskia/db/structs.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/paskia/db/structs.py b/paskia/db/structs.py index 7c37148..82eb2aa 100644 --- a/paskia/db/structs.py +++ b/paskia/db/structs.py @@ -28,7 +28,7 @@ class Permission(msgspec.Struct, dict=True, omit_defaults=True): orgs: dict[UUID, bool] = {} # org_uuid -> True (which orgs can grant this) def __post_init__(self): - if getattr(self, "uuid", _UUID_UNSET) == _UUID_UNSET: + if not hasattr(self, "uuid"): self.uuid: UUID = _UUID_UNSET @property @@ -68,7 +68,7 @@ class Org(msgspec.Struct, dict=True): display_name: str def __post_init__(self): - if getattr(self, "uuid", _UUID_UNSET) == _UUID_UNSET: + if not hasattr(self, "uuid"): self.uuid: UUID = _UUID_UNSET @property @@ -102,7 +102,7 @@ class Role(msgspec.Struct, dict=True, omit_defaults=True): permissions: dict[UUID, bool] = {} # permission_uuid -> True def __post_init__(self): - if getattr(self, "uuid", _UUID_UNSET) == _UUID_UNSET: + if not hasattr(self, "uuid"): self.uuid: UUID = _UUID_UNSET @property @@ -162,7 +162,7 @@ class User(msgspec.Struct, dict=True): visits: int = 0 def __post_init__(self): - if getattr(self, "uuid", _UUID_UNSET) == _UUID_UNSET: + if not hasattr(self, "uuid"): self.uuid: UUID = _UUID_UNSET @property @@ -226,7 +226,7 @@ class Credential(msgspec.Struct, dict=True): last_verified: datetime | None = None def __post_init__(self): - if getattr(self, "uuid", _UUID_UNSET) == _UUID_UNSET: + if not hasattr(self, "uuid"): self.uuid: UUID = _UUID_UNSET @property @@ -284,7 +284,7 @@ class Session(msgspec.Struct, dict=True): expiry: datetime def __post_init__(self): - if not getattr(self, "key", ""): + if not hasattr(self, "key"): self.key: str = "" @property @@ -344,7 +344,7 @@ class ResetToken(msgspec.Struct, dict=True): token_type: str def __post_init__(self): - if not getattr(self, "key", b""): + if not hasattr(self, "key"): self.key: bytes = b"" @property