refactor: centralize default end user session ID constant (#25416)

This PR refactors the handling of the default end user session ID by centralizing it as an enum in the models module where the `EndUser` model is defined. This improves code organization and makes the relationship between the constant and the model clearer.

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
This commit is contained in:
Yeuoly
2025-09-12 10:27:16 +08:00
committed by GitHub
parent 394b0ac9c0
commit ec808f3fe8
6 changed files with 17 additions and 23 deletions

View File

@@ -1459,6 +1459,14 @@ class OperationLog(Base):
updated_at = mapped_column(sa.DateTime, nullable=False, server_default=func.current_timestamp())
class DefaultEndUserSessionID(StrEnum):
"""
End User Session ID enum.
"""
DEFAULT_SESSION_ID = "DEFAULT-USER"
class EndUser(Base, UserMixin):
__tablename__ = "end_users"
__table_args__ = (