working now

This commit is contained in:
HotSwapp
2025-08-10 19:06:21 -05:00
parent c2f3c4411d
commit 350af60db3
10 changed files with 248 additions and 11 deletions

View File

@@ -9,6 +9,9 @@ from fastapi import Request
from app.models.audit import AuditLog, LoginAttempt
from app.models.user import User
from app.core.logging import get_logger
logger = get_logger("audit")
class AuditService:
@@ -73,7 +76,7 @@ class AuditService:
except Exception as e:
db.rollback()
# Log the error but don't fail the main operation
print(f"Failed to log audit entry: {e}")
logger.error("Failed to log audit entry", error=str(e), action=action, user_id=user_id)
return audit_log
@staticmethod
@@ -128,7 +131,7 @@ class AuditService:
except Exception as e:
db.rollback()
# Log the error but don't fail the main operation
print(f"Failed to log login attempt: {e}")
logger.error("Failed to log login attempt", error=str(e), username=username, success=success)
return login_attempt
@staticmethod