feat(server): propagate is_test_account through User model & store
User dataclass, create_user, and all SELECT lists now round-trip the new column. Value is always FALSE until Task 4 wires the register flow to the invite code's marks_as_test flag. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -45,6 +45,7 @@ class User:
|
||||
is_banned: Whether user is banned.
|
||||
ban_reason: Reason for ban (if banned).
|
||||
force_password_reset: Whether user must reset password on next login.
|
||||
is_test_account: True for accounts created by the soak test harness.
|
||||
"""
|
||||
id: str
|
||||
username: str
|
||||
@@ -66,6 +67,7 @@ class User:
|
||||
is_banned: bool = False
|
||||
ban_reason: Optional[str] = None
|
||||
force_password_reset: bool = False
|
||||
is_test_account: bool = False
|
||||
|
||||
def is_admin(self) -> bool:
|
||||
"""Check if user has admin role."""
|
||||
@@ -100,6 +102,7 @@ class User:
|
||||
"is_banned": self.is_banned,
|
||||
"ban_reason": self.ban_reason,
|
||||
"force_password_reset": self.force_password_reset,
|
||||
"is_test_account": self.is_test_account,
|
||||
}
|
||||
if include_sensitive:
|
||||
d["password_hash"] = self.password_hash
|
||||
@@ -146,6 +149,7 @@ class User:
|
||||
is_banned=d.get("is_banned", False),
|
||||
ban_reason=d.get("ban_reason"),
|
||||
force_password_reset=d.get("force_password_reset", False),
|
||||
is_test_account=d.get("is_test_account", False),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user