This commit is contained in:
2026-01-28 19:17:24 +00:00
parent 8f89bb6d4b
commit c1b0aab296
+7 -7
View File
@@ -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