Development

This commit is contained in:
Matthew Grotke 2026-06-12 16:22:50 -04:00
parent 1beb660be1
commit 025adb9f15
4 changed files with 15 additions and 7 deletions

View file

@ -68,6 +68,7 @@ def form_login():
session.clear() session.clear()
session['account_id'] = account['account_id'] session['account_id'] = account['account_id']
session['tz_offset_seconds'] = settings.get_host_utc_offset() session['tz_offset_seconds'] = settings.get_host_utc_offset()
session['timezone'] = settings.get_host_timezone()
session['apply_changes_immediately'] = False session['apply_changes_immediately'] = False
session.permanent = True session.permanent = True

View file

@ -81,13 +81,6 @@
"method": "post", "method": "post",
"items": [ "items": [
{"type": "hidden", "name": "row_index", "value": ""}, {"type": "hidden", "name": "row_index", "value": ""},
{
"type": "field",
"label": "Email Address",
"name": "email_address_display",
"input_type": "text",
"value": ""
},
{ {
"type": "field", "type": "field",
"label": "Access Level", "label": "Access Level",

View file

@ -55,6 +55,7 @@ class SqliteSessionInterface(SessionInterface):
'timezone': str(prefs.get('timezone', '')), 'timezone': str(prefs.get('timezone', '')),
'apply_changes_immediately': bool(prefs.get('apply_changes_immediately', False)), 'apply_changes_immediately': bool(prefs.get('apply_changes_immediately', False)),
'_flashes': flashes, '_flashes': flashes,
'_permanent': True,
} }
con.close() con.close()
return SqliteSession(data, sid=sid, new=False) return SqliteSession(data, sid=sid, new=False)

View file

@ -31,6 +31,19 @@ def get_host_utc_offset():
return time.localtime().tm_gmtoff return time.localtime().tm_gmtoff
def get_host_timezone():
"""Return the host timezone name (e.g. 'America/New_York'), or '' if unknown."""
tz = os.environ.get('TZ', '').strip()
if tz:
return tz
try:
with open('/etc/timezone') as f:
return f.read().strip()
except OSError:
pass
return ''
def get_credentials_key(): def get_credentials_key():
"""Return a Fernet-compatible key derived from the CREDENTIALS_KEY environment variable, """Return a Fernet-compatible key derived from the CREDENTIALS_KEY environment variable,
or None if not set. SHA-256 hashes the raw string to produce 32 bytes, which are then or None if not set. SHA-256 hashes the raw string to produce 32 bytes, which are then