left4me/l4d2web/l4d2web/routes
mwiegand 18113637e9
refactor(datetime): introduce UtcDateTime, remove naive-strip workarounds
Adds a UtcDateTime TypeDecorator (models.py) that enforces aware-UTC on
write and stamps tzinfo=UTC on read. Replaces 26 DateTime column
declarations. Removes 5 production sites that defensively stripped tzinfo
to match SQLite's lossy round-trip. auth.py now coerces legacy session
cookies upward (stamp UTC on parsed naive marker) instead of stripping
live aware markers downward.

The change is Python-side only: UtcDateTime.impl = DateTime, so DDL and
emitted SQL are unchanged. No Alembic migration needed.

Adds 2 unit tests in test_models.py pinning the decorator's contract
independently of the column declarations.

The three deliberately-naive test_timeago.py fixtures (lines 67, 73, 113)
remain naive on purpose -- they exercise _ensure_utc's normalize-up path
at the public filter boundary, which stays as belt-and-braces defense.

See docs/superpowers/specs/2026-05-16-tz-aware-datetime-design.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 11:59:29 +02:00
..
__init__.py refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00
auth_routes.py refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00
blueprint_routes.py refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00
console_routes.py refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00
files_routes.py refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00
job_routes.py refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00
log_routes.py refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00
overlay_routes.py refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00
page_routes.py refactor(datetime): introduce UtcDateTime, remove naive-strip workarounds 2026-05-16 11:59:29 +02:00
profile_routes.py refactor(datetime): introduce UtcDateTime, remove naive-strip workarounds 2026-05-16 11:59:29 +02:00
server_routes.py refactor(datetime): introduce UtcDateTime, remove naive-strip workarounds 2026-05-16 11:59:29 +02:00
workshop_routes.py refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00