linuxrouter/docker/routlin-dash/app/pages/preferences/view.py
2026-06-07 00:21:08 -04:00

13 lines
469 B
Python

import json
from flask import session
import sanitize
import config_utils
def collect_tokens(cfg):
tokens = config_utils.collect_layout_tokens(cfg)
blank = [{'value': '', 'label': '-- Select timezone --'}]
tokens['PREF_EMAIL'] = session.get('email_address', '')
tokens['PREF_TIMEZONE'] = session.get('timezone', '')
tokens['TIMEZONE_OPTIONS'] = json.dumps(blank + [{'value': tz, 'label': tz} for tz in sanitize.VALID_TIMEZONES])
return tokens