Fix: Alle Timestamps einheitlich auf Europe/Berlin Zeitzone
Inkonsistenz behoben: Manche Timestamps wurden in UTC, andere in Berlin-Zeit gespeichert. Das fuehrte zu Fehlern beim Auto-Refresh und Faktencheck, da Zeitvergleiche falsche Ergebnisse lieferten. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Dieser Commit ist enthalten in:
@@ -1,6 +1,6 @@
|
||||
"""Lizenz-Verwaltung und -Pruefung."""
|
||||
import logging
|
||||
from datetime import datetime, timezone
|
||||
from datetime import datetime
|
||||
from config import TIMEZONE
|
||||
import aiosqlite
|
||||
|
||||
@@ -38,14 +38,14 @@ async def check_license(db: aiosqlite.Connection, organization_id: int) -> dict:
|
||||
return {"valid": False, "status": "no_license", "read_only": True, "message": "Keine aktive Lizenz"}
|
||||
|
||||
# Ablauf pruefen
|
||||
now = datetime.now(timezone.utc)
|
||||
now = datetime.now(TIMEZONE)
|
||||
valid_until = license_row["valid_until"]
|
||||
|
||||
if valid_until is not None:
|
||||
try:
|
||||
expiry = datetime.fromisoformat(valid_until)
|
||||
if expiry.tzinfo is None:
|
||||
expiry = expiry.replace(tzinfo=timezone.utc)
|
||||
expiry = expiry.replace(tzinfo=TIMEZONE)
|
||||
if now > expiry:
|
||||
return {
|
||||
"valid": False,
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren