Refactor backend: Split models and proxmox_client into modules, add alembic
Some checks failed
Backend Tests / pytest (Python 3.12) (push) Failing after 2m27s
Some checks failed
Backend Tests / pytest (Python 3.12) (push) Failing after 2m27s
This commit is contained in:
@@ -96,3 +96,12 @@ def utcnow() -> datetime:
|
||||
with PostgreSQL columns that have timezone=True.
|
||||
"""
|
||||
return datetime.now(timezone.utc)
|
||||
|
||||
|
||||
def make_tz_aware(dt: Optional[datetime]) -> Optional[datetime]:
|
||||
"""Ensure datetime is timezone-aware. Defaults to UTC if naive."""
|
||||
if dt is None:
|
||||
return None
|
||||
if dt.tzinfo is None:
|
||||
return dt.replace(tzinfo=timezone.utc)
|
||||
return dt
|
||||
|
||||
Reference in New Issue
Block a user