Commit c8c7e12c authored by Your Name's avatar Your Name

Fix TypeError in dashboard index for MySQL datetime handling

- Check if timestamp is string before calling fromisoformat()
- MySQL returns datetime objects directly, SQLite returns strings
- Fixes login error: 'fromisoformat: argument must be str'
parent dbb5d305
...@@ -3859,7 +3859,7 @@ async def dashboard_index(request: Request): ...@@ -3859,7 +3859,7 @@ async def dashboard_index(request: Request):
today = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0) today = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
usage_stats['requests_today'] = len([ usage_stats['requests_today'] = len([
row for row in token_usage row for row in token_usage
if datetime.fromisoformat(row['timestamp']) >= today if (datetime.fromisoformat(row['timestamp']) if isinstance(row['timestamp'], str) else row['timestamp']) >= today
]) ])
# Get user config counts # Get user config counts
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment