Skip to content

Fix dashboard error 500 from feeder form timestamps#7

Open
LeeOtts wants to merge 1 commit intomainfrom
claude/fix-dashboard-error-500-lCF1o
Open

Fix dashboard error 500 from feeder form timestamps#7
LeeOtts wants to merge 1 commit intomainfrom
claude/fix-dashboard-error-500-lCF1o

Conversation

@LeeOtts
Copy link
Copy Markdown
Owner

@LeeOtts LeeOtts commented Apr 11, 2026

Summary

  • Fix timezone-naive timestamps from the HTML datetime-local input crashing get_feeder_stats() with a TypeError on every dashboard load
  • Normalize timestamps to include timezone in record_refill() and record_production() at write time
  • Handle any existing naive timestamps in the database at read time in get_feeder_stats()
  • Wrap analytics loading in try/except so a data error can't take down the entire dashboard

Test plan

  • All 91 sightings/analytics tests pass
  • Verified naive timestamp refill no longer crashes get_feeder_stats()
  • Confirm dashboard loads without 500 after pulling to Pi

https://claude.ai/code/session_01ED6k8gWg1LZYc8pFBTSCHQ

The HTML datetime-local input sends timestamps without timezone info
(e.g. "2026-04-11T10:30"). When get_feeder_stats() later subtracted
this naive datetime from a timezone-aware datetime.now(), Python raised
TypeError, causing an unhandled 500 on every dashboard load. Fix by
normalizing timestamps at write time in record_refill/record_production
and at read time in get_feeder_stats. Also wrap analytics loading in
try/except so a data error can't take down the entire dashboard.

https://claude.ai/code/session_01ED6k8gWg1LZYc8pFBTSCHQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants