maziggy
fe5bb1fd90
Fix naive-vs-aware datetime crash from 0.2.1 timezone migration
The timezone fix (ed36eaf) replaced datetime.utcnow() with
datetime.now(timezone.utc) across ~80 call sites, but SQLAlchemy's
SQLite DateTime columns strip tzinfo on read, returning naive datetimes.
Any Python-side comparison (subtraction, <, >) between an aware "now"
and a naive DB value raises TypeError.
Add `if value.tzinfo is None: value = value.replace(tzinfo=timezone.utc)`
guards at all 8 affected comparison sites:
- maintenance.py: last_performed_at subtraction (500 on /maintenance/overview)
- auth.py: API key expires_at check (2 locations)
- print_scheduler.py: scheduled_time comparison
- smart_plug_manager.py: auto_off_pending_since elapsed calc
- smart_plugs.py: power_alert_last_triggered cooldown
- main.py: last_runtime_update elapsed calc
- archives.py: timelapse completed_at fallback
2026-02-27 17:39:32 +01:00
..
2026-02-27 10:05:03 +01:00
2026-01-02 15:00:21 +01:00
2026-02-24 08:58:35 +01:00
2026-02-21 09:51:42 +01:00
2026-02-24 08:18:02 +01:00
2026-02-20 09:26:50 +01:00
2026-02-24 08:18:02 +01:00
2026-02-06 11:58:38 +01:00
2026-02-24 08:18:02 +01:00
2026-02-10 02:08:03 +00:00
2026-01-02 10:24:31 +01:00
2026-02-11 07:09:39 +01:00
2026-02-24 08:18:02 +01:00
2026-02-15 13:20:54 +01:00
2026-02-06 16:29:01 +01:00
2026-02-06 11:37:59 +01:00
2026-01-27 08:48:57 +01:00
2026-02-07 09:20:06 +01:00
2026-02-06 11:37:59 +01:00
2026-02-24 08:18:02 +01:00
2026-02-24 08:18:02 +01:00
2026-02-18 06:37:27 +01:00
2026-02-24 08:18:02 +01:00
2026-02-09 17:00:02 +01:00
2026-02-06 11:58:38 +01:00
2026-02-15 13:14:15 +01:00
2026-02-27 17:39:32 +01:00
2026-02-19 09:42:11 +01:00
2026-02-27 17:39:32 +01:00
2026-02-15 08:04:01 +01:00
2026-02-15 08:04:01 +01:00
2026-02-13 11:48:32 +01:00
2026-02-06 11:37:59 +01:00
2026-02-21 08:17:59 +01:00
2026-02-06 12:19:17 +01:00
2026-02-24 08:58:35 +01:00