Validate AVConnect credentials on saving. Improved AVConnect login method. Fixed issue with UTC datetimes
This commit is contained in:
@@ -1,7 +1,19 @@
|
||||
import logging
|
||||
import os
|
||||
from datetime import datetime, timezone
|
||||
from typing import Optional
|
||||
|
||||
|
||||
def utcnow() -> datetime:
|
||||
"""Return the current UTC time as a timezone-naive datetime.
|
||||
|
||||
SQLite (and SQLAlchemy's default column handling) stores datetimes without
|
||||
timezone info. Using this helper keeps all DB timestamps and comparisons
|
||||
consistent and avoids TypeError on offset-naive vs offset-aware comparisons.
|
||||
"""
|
||||
return datetime.now(timezone.utc).replace(tzinfo=None)
|
||||
|
||||
|
||||
# ── Paths ─────────────────────────────────────────────────────────────────────
|
||||
_HERE = os.path.dirname(os.path.abspath(__file__)) # src/core/
|
||||
_SRC_DIR = os.path.dirname(_HERE) # src/
|
||||
|
||||
Reference in New Issue
Block a user