Update routes.py

This commit is contained in:
admin 2026-10-04 03:51:12 +00:00
parent 7383f4b131
commit 1e62f67b76

View File

@ -108,13 +108,27 @@ def register_routes(app, ctx):
MAX_WEBSITE_LENGTH = constants["MAX_WEBSITE_LENGTH"]
MAX_LOCATION_LENGTH = constants["MAX_LOCATION_LENGTH"]
MAX_CUSTOM_CSS_LENGTH = constants["MAX_CUSTOM_CSS_LENGTH"]
MAX_PROFILE_BADGE_LENGTH = constants["MAX_PROFILE_BADGE_LENGTH"]
MAX_OWNED_TEAMS_PER_USER = constants["MAX_OWNED_TEAMS_PER_USER"]
ROOM_VISIBILITIES = constants["ROOM_VISIBILITIES"]
ROLES = constants["ROLES"]
STATUSES = constants["STATUSES"]
PRIVATE_ACCESS_KEY = ctx["PRIVATE_ACCESS_KEY"]
ROLES = constants["ROLES"]
STATUSES = constants["STATUSES"]
html_module = ctx["html"]
def private_access_key_valid(candidate: object) -> bool:
configured = (PRIVATE_ACCESS_KEY or "").strip()
if not configured:
return True
if not isinstance(candidate, str):
return False
return candidate.strip() == configured
def build_message_payload(row, user):
return richer_message_payload(
get_db,